[issue19159] 2to3 incorrectly converts two parameter unicode() constructor to str()

2017-03-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> wont fix stage: needs patch -> resolved status: pending -> closed ___ Python tracker ___

[issue19159] 2to3 incorrectly converts two parameter unicode() constructor to str()

2016-11-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue19159] 2to3 incorrectly converts two parameter unicode() constructor to str()

2013-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Just add the "b" prefix to literal string argument of unicode() in Python 2. -- ___ Python tracker ___ ___

[issue19159] 2to3 incorrectly converts two parameter unicode() constructor to str()

2013-10-04 Thread Gregory P. Smith
Gregory P. Smith added the comment: Correct, my characterization above was wrong (I shouldn't write these up without the interpreter right in front of me). What is wrong with the conversion is: unicode("", "utf-8") in python 2.x should become either str(b"", "utf-8") or, better, just "" in Py

[issue19159] 2to3 incorrectly converts two parameter unicode() constructor to str()

2013-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is not a bug, str accepts the encoding argument in Python 3. And in contrast to the decode method it works with arbitrary byte-like objects (i.e. array.array). -- nosy: +serhiy.storchaka ___ Python tracker <

[issue19159] 2to3 incorrectly converts two parameter unicode() constructor to str()

2013-10-03 Thread Gregory P. Smith
New submission from Gregory P. Smith: >From a conversion through 2to3: < default_value=unicode("", "utf-8"), --- > default_value=str("", "utf-8"), The Python 2 unicode constructor takes an optional second parameter which is the codec to use to convert when the first parameter is no