[issue21343] os.path.relpath returns inconsistent types

Matt Bachmann report at bugs.python.org
Mon May 26 06:55:06 CEST 2014


Matt Bachmann added the comment:

Looking into the project im working on I discovered why relpath was acting strangely.

It is because the project mocks get_cwd but not get_cwdu. Your request helped me track that down :-)

So that is not an issue. However, the issue described in the original ticket definitely happens in a clean python shell.

I still think it is bad that the method sometimes returns str and sometimes returns unicode, but I see your point that ultimately the byte strings that do come out of here coerce into unicode cleanly.

Thanks for working though this with me.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21343>
_______________________________________


More information about the Python-bugs-list mailing list