Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os.path.relpath fails when path == start #46083

Closed
townerj mannequin opened this issue Jan 6, 2008 · 2 comments
Closed

os.path.relpath fails when path == start #46083

townerj mannequin opened this issue Jan 6, 2008 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@townerj
Copy link
Mannequin

townerj mannequin commented Jan 6, 2008

BPO 1742
Nosy @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-01-06.14:27:26.387>
created_at = <Date 2008-01-06.12:14:00.624>
labels = ['type-bug', 'library']
title = 'os.path.relpath fails when path == start'
updated_at = <Date 2008-01-06.14:27:26.386>
user = 'https://bugs.python.org/townerj'

bugs.python.org fields:

activity = <Date 2008-01-06.14:27:26.386>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = <Date 2008-01-06.14:27:26.387>
closer = 'georg.brandl'
components = ['Library (Lib)']
creation = <Date 2008-01-06.12:14:00.624>
creator = 'townerj'
dependencies = []
files = []
hgrepos = []
issue_num = 1742
keywords = []
message_count = 2.0
messages = ['59358', '59374']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'townerj']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue1742'
versions = ['Python 3.0']

@townerj townerj mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jan 6, 2008
@townerj
Copy link
Mannequin Author

townerj mannequin commented Jan 6, 2008

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)

@birkenfeld
Copy link
Member

Thanks, fixed in r59770.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant