
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2019-03-15 05:32 bymethane, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 12342 | merged | methane,2019-03-15 12:42 | |
| Messages (9) | |||
|---|---|---|---|
| msg337965 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2019-03-15 05:32 | |
unicode_internal codec is deprecated since Python 3.3.It raises DeprecationWarning from 3.3.>>> "hello".encode('unicode_internal')__main__:1: DeprecationWarning: unicode_internal codec has been deprecatedb'h\x00\x00\x00e\x00\x00\x00l\x00\x00\x00l\x00\x00\x00o\x00\x00\x00'May I remove it in 3.8? | |||
| msg337976 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-03-15 09:26 | |
I found:* _PyUnicode_DecodeUnicodeInternal()* _codecs.unicode_internal_decode()* _codecs.unicode_internal_encode()*Lib/encodings/unicode_internal.pyFiles which contain "unicode_internal":Doc/library/codecs.rstDoc/whatsnew/3.3.rstLib/encodings/unicode_internal.pyLib/test/test_codeccallbacks.pyLib/test/test_codecs.pyLib/test/test_unicode.pyMisc/HISTORYModules/_codecsmodule.cModules/clinic/_codecsmodule.c.hObjects/unicodeobject.cPCbuild/lib.pyproj> May I remove it in 3.8?Since using the codec emits a DeprecationWarning at runtime, I think that it's safe to remove it. | |||
| msg338000 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2019-03-15 16:35 | |
What is the purpose of the unicode-internal codec at first place? | |||
| msg338005 -(view) | Author: Marc-Andre Lemburg (lemburg)*![]() | Date: 2019-03-15 16:51 | |
On 15.03.2019 17:35, Serhiy Storchaka wrote:> > What is the purpose of the unicode-internal codec at first place?It provides a fast and direct access to the internal representation ofUnicode used in Python to the outside world. | |||
| msg338006 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2019-03-15 16:55 | |
Is it for debugging only? | |||
| msg338009 -(view) | Author: Marc-Andre Lemburg (lemburg)*![]() | Date: 2019-03-15 17:05 | |
On 15.03.2019 17:55, Serhiy Storchaka wrote:> Is it for debugging only?No, you can use it to store Unicode object as-is without anyencoding/decoding, but after the recent changes to the internalsof the Unicode implementation it's not all that useful anymore,since we now have per object state which is not reflected by thecodec. | |||
| msg338164 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2019-03-18 06:44 | |
New changeset6a16b18224fa98f6d192aa5014affeccc0376eb3 by Inada Naoki in branch 'master':bpo-36297: remove "unicode_internal" codec (GH-12342)https://github.com/python/cpython/commit/6a16b18224fa98f6d192aa5014affeccc0376eb3 | |||
| msg338184 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-03-18 09:34 | |
Thanks INADA-san. IMHO Python has too many codecs, it's painful to maintain them. So it's nice to see deprecate ones to be removed.Next step: remove all deprecated APIs using Py_UNICODE* :-D (I know that Serhiy is working on that.) | |||
| msg338190 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2019-03-18 10:08 | |
I tried to remove all legacy API and wchar_t cache in unicodeobject. This is experimental branch.https://github.com/methane/cpython/pull/18/filesI'm thinking about adding configure option to remove them from 3.8.* It may help people to find third party extensions using legacy API.* Projects which doesn't use such third party extension can use this option to reduce some memory usage (8 byte for all unicode object). | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:12 | admin | set | github: 80478 |
| 2019-03-18 10:08:24 | methane | set | messages: +msg338190 |
| 2019-03-18 09:34:20 | vstinner | set | messages: +msg338184 |
| 2019-03-18 06:44:28 | methane | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2019-03-18 06:44:13 | methane | set | messages: +msg338164 |
| 2019-03-15 17:05:40 | lemburg | set | messages: +msg338009 |
| 2019-03-15 16:55:22 | serhiy.storchaka | set | messages: +msg338006 |
| 2019-03-15 16:51:45 | lemburg | set | nosy: +lemburg messages: +msg338005 |
| 2019-03-15 16:35:33 | serhiy.storchaka | set | nosy: +serhiy.storchaka messages: +msg338000 |
| 2019-03-15 12:42:35 | methane | set | keywords: +patch stage: patch review pull_requests: +pull_request12309 |
| 2019-03-15 09:26:11 | vstinner | set | messages: +msg337976 |
| 2019-03-15 05:32:43 | methane | create | |