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.

Title: PEP 349: allow str() to return unicode
Type: enhancement Stage: test needed
Components: Unicode Versions: Python 2.7
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: ajaksu2, alexandre.vassalotti, ezio.melotti, nascheme, vstinner
Priority: normal Keywords: patch

Created on 2005-08-22 20:54 by nascheme, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
str-return-unicode.diff nascheme, 2005-08-22 20:55
Messages (6)
msg48664 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2005-08-22 20:54
The patch implements PEP 349: "Allow str() to return
unicode strings".  The backwards compatibility problems
appear to be rare.  Hopefully more people can test
their applications.  I'm not very happy with the new
function named PyString_New since it really belongs in
Python/object.c, not stringobject.c.  However, I can't
think of a better name.  I think it should be made
available to extension modules somehow so _PyObject_Str
is no good.
msg48665 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2005-08-22 20:55
Logged In: YES 

Attaching patch (forgot to click on stupid checkbox).
msg58292 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2007-12-08 05:14
The PEP has been deferred and the patch is out of date.  So, is this
change still wanted?
msg58298 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2007-12-08 16:59
On Sat, Dec 08, 2007 at 05:14:45AM -0000, Alexandre Vassalotti wrote:
> The PEP has been deferred and the patch is out of date.  So, is this
> change still wanted?

I still think it would make things easier for people using Unicode
with Python 2.x.  However, there does not seem to be much community
interest in the change.

msg86707 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-04-27 22:52
Maybe something useful for 2.7?
msg87085 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-05-03 23:48
PEP 349 was rejected because it breaks backward compatibility, eg. it 
breaks the assomption that str(u"x") converts unicode to byte string.

Python3 is the only good fix for all byte/character Python2 issues.
Date User Action Args
2022-04-11 14:56:12adminsetgithub: 42297
2009-05-03 23:48:28vstinnersetstatus: open -> closed
resolution: out of date -> rejected
messages: + msg87085
2009-04-27 22:52:59ajaksu2settype: enhancement
components: + Unicode, - None
versions: + Python 2.7
nosy: + ezio.melotti, vstinner, ajaksu2

messages: + msg86707
stage: test needed
2007-12-08 16:59:20naschemesetmessages: + msg58298
2007-12-08 05:14:45alexandre.vassalottisetresolution: out of date
messages: + msg58292
nosy: + alexandre.vassalotti
2005-08-22 20:54:30naschemecreate