[issue1742] os.path.relpath fails when path == start

Jesse Towner report at bugs.python.org
Sun Jan 6 13:18:26 CET 2008


New submission from Jesse Towner:

os.path.relpath fails with an exception on both Windows and Unix systems
(ntpath and posixpath modules) when the given path and the start path
are equal. Better behavior here might be to return an empty string or
perhaps os.path.curdir.

>>> os.path.relpath("test", "test")
Traceback (most recent call last):
  File "<pyshell#40>", line 1, in <module>
    os.path.relpath("test", "test")
  File "C:\Program Files\Python3K\Lib\ntpath.py", line 495, in relpath
    return join(*rel_list)
TypeError: join() takes at least 1 positional argument (0 given)

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1742>
__________________________________


More information about the Python-bugs-list mailing list