[issue6450] normpath() sometimes maps unicode to str

Erik Sandberg report at bugs.python.org
Thu Jul 9 20:49:56 CEST 2009


New submission from Erik Sandberg <sandberg at virtutech.com>:

On Linux, I get the following:

>>> import os
>>> os.path.normpath(u'/')
'/'

I would expect unicode to be mapped to unicode. os.path.abspath() has
the same problem, see also issue 3426.

This causes problems in my project, where a function requires its
parameters to be Unicode. Do the standard Python library functions that
operate on strings guarantee anything in general with respect to
conserving unicode? Can I make any assumption as to which codec was used
to encode the str returned from normpath?

----------
components: Library (Lib)
messages: 90341
nosy: sandberg
severity: normal
status: open
title: normpath() sometimes maps unicode to str
type: behavior
versions: Python 2.6

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


More information about the Python-bugs-list mailing list