Nov. 6, 2012
3:27 p.m.
See http://bugs.python.org/issue10395. os.path.commonpath() should be a function which returns right longest common sub-path for specified paths (os.path.commonprefix() is completely useless for this). There are some open questions about details of *right* behavior. What should be a common prefix of '/var/log/apache2' and '/var//log/mysql'? What should be a common prefix of '/usr' and '//usr'? What should be a common prefix of '/usr/local/' and '/usr/local/'? What should be a common prefix of '/usr/local/' and '/usr/local/bin'? What should be a common prefix of '/usr/bin/..' and '/usr/bin'? Please, those who are interested in this feature, give consistent answers to these questions.