Hide Forgot
Description of problem: os.path.relpath(path[, start]) returns incorrect result, when the 'start' argument is set to '/'. Version-Release number of selected component (if applicable): python-2.7-8.fc14.1.x86_64 Actual results: # python2.7 Python 2.7 (r27:82500, Sep 16 2010, 18:02:00) [GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.path.relpath("/etc/passwd", "/") '../etc/passwd' >>> os.path.relpath("/etc/passwd", "/root") '../etc/passwd' >>> Expected results (python-2.7.1-7.fc16.x86_64): # python2.7 Python 2.7.1 (r271:86832, Apr 12 2011, 16:12:28) [GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.path.relpath("/etc/passwd", "/") 'etc/passwd' >>> os.path.relpath("/etc/passwd", "/root") '../etc/passwd' >>> Additional info: http://bugs.python.org/issue5117
The bug is fixed in F16.