[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +850 ___ Python tracker ___ ___

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-30 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: > New changeset 15a494886c5a by Serhiy Storchaka in branch '3.6': > Issue #28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(), > https://hg.python.org/cpython/rev/15a494886c5a s/that encode form str/that encode from str/

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Xiang. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 15a494886c5a by Serhiy Storchaka in branch '3.6': Issue #28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(), https://hg.python.org/cpython/rev/15a494886c5a New changeset 50c28727d91c by Serhiy Storchaka in branch 'default': Issue

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-25 Thread Xiang Zhang
Xiang Zhang added the comment: LGTM. I can understand the wording. -- ___ Python tracker ___ ___

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka dependencies: +Use PyUnicode_AsEncodedString instead of PyUnicode_AsEncodedObject ___ Python tracker

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > BTW Serhiy, how about PyUnicode_AsEncodedObject? Not see it in your deprecate > list. Indeed. It is not such useless as other functions (that support only the rot13 encoding), but it can be replaced with either PyUnicode_AsEncodedString or PyCodec_Encode

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 71dce630dc02 by Serhiy Storchaka in branch '3.4': Issue #28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug build. https://hg.python.org/cpython/rev/71dce630dc02 New changeset 74569ecd67e4 by Serhiy Storchaka in branch '3.5':

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 25.10.2016 04:16, Xiang Zhang wrote: > Marc-Andre, shouldn't the C API of unicode.encode() be > PyUnicode_AsEncodedString instead of PyUnicode_AsEncodedUnicode now? You're right. I got confused with all the slight variations. > BTW Serhiy, how about

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-24 Thread Xiang Zhang
Xiang Zhang added the comment: Marc-Andre, shouldn't the C API of unicode.encode() be PyUnicode_AsEncodedString instead of PyUnicode_AsEncodedUnicode now? BTW Serhiy, how about PyUnicode_AsEncodedObject? Not see it in your deprecate list. -- ___

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: As I already mentioned, PyUnicode_AsEncodedUnicode() needs to stay, since it's the C API for unicode.encode(). The others can be deprecated. -- ___ Python tracker

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Marc-Andre, what are your thoughts about this? -- ___ Python tracker ___

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-13 Thread Xiang Zhang
Xiang Zhang added the comment: +1 for 2). Patch looks good. -- ___ Python tracker ___ ___ Python-bugs-list

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I propose following: 1) Fix a crash in PyUnicode_AsDecodedObject by removing unicode_result() in all maintained 3.x versions (starting from 3.4? or 3.3?). 2) Deprecate PyUnicode_AsDecodedObject, PyUnicode_AsDecodedUnicode and PyUnicode_AsEncodedUnicode in

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file45071/deprecate-str-to-str-coding-unicode-api.patch ___ Python tracker

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 13.10.2016 10:10, Serhiy Storchaka wrote: > Shouldn't all these function be deprecated in favour of PyCodec_*() APIs? Not all of them, since you still want to have a C API for unicode.encode(). PyUnicode_AsEncodedUnicode() would have to stay. As for the

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Shouldn't all these function be deprecated in favour of PyCodec_*() APIs? -- ___ Python tracker ___

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: PyUnicode_AsDecodedObject() and PyUnicode_AsEncodedObject() were meant as C API implementations of the unicode.decode() and unicode.encode() methods in Python2. Not having PyUnicode_AsDecodedObject() documented was likely an oversight on my part. In

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Indeed. The only difference is that PyUnicode_AsDecodedUnicode fails for most encodings (except rot13), but PyUnicode_AsDecodedObject just crashes in debug build. It seems to me that these functions (as well as PyUnicode_AsEncodedUnicode) shouldn't exist it

[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-12 Thread Xiang Zhang
New submission from Xiang Zhang: PyUnicode_AsDecodedObject was added in f46d49e2e0f0 and became an API in 2284fa89ab08. It seems its intention is to return a Python object. But during evolution, with commits 5f11621a6f51 and 123f2dc08b3e, it can only return unicode now, becoming another