Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue6450] normpath() sometimes maps unicode to str

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 9, 2009, 11:49 AM

Post #1 of 3 (140 views)
Permalink
[issue6450] normpath() sometimes maps unicode to str

New submission from Erik Sandberg <sandberg [at] virtutech>:

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>
<http://bugs.python.org/issue6450>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2009, 12:02 PM

Post #2 of 3 (117 views)
Permalink
[issue6450] normpath() sometimes maps unicode to str [In reply to]

Changes by Ezio Melotti <ezio.melotti [at] gmail>:


----------
components: +Unicode
nosy: +ezio.melotti
priority: -> normal
stage: -> test needed
versions: +Python 2.7

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6450>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2009, 12:02 PM

Post #3 of 3 (120 views)
Permalink
[issue6450] normpath() sometimes maps unicode to str [In reply to]

Martin v. Löwis <martin [at] v> added the comment:

> 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?

The bug tracker is not really a place to ask questions. Please ask them
on python-list or elsewhere, or read the source code of normpath.

----------
nosy: +loewis

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6450>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.