This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Matt.Bachmann
Recipients Matt.Bachmann
Date 2014-04-24.06:40:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1398321622.3.0.761606734891.issue21343@psf.upfronthosting.co.za>
In-reply-to
Content
I noticed an issue passing in unicode to os.path.relpath.

Specifically that in some cases when passing in unicode I would get back unicode and others I would get back a string. Below I demonstrate the issue. I also attached a patch.

Is this an issue or am I misunderstanding something. Is the patch reasonable? Totally willing to improve and i'll admit I cannot test the ntpath version.

Python 2.7.6 (default, Apr  9 2014, 11:48:52)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.relpath(u'.', u'.')
'.'
>>> os.path.relpath(u'.', u'../')
u'bachmann'
History
Date User Action Args
2014-04-24 06:40:22Matt.Bachmannsetrecipients: + Matt.Bachmann
2014-04-24 06:40:22Matt.Bachmannsetmessageid: <1398321622.3.0.761606734891.issue21343@psf.upfronthosting.co.za>
2014-04-24 06:40:22Matt.Bachmannlinkissue21343 messages
2014-04-24 06:40:21Matt.Bachmanncreate