Compile Python 3 interpreter to force 2-byte unicode

Chris Angelico rosuav at gmail.com
Sun Nov 26 00:00:56 EST 2017


On Sun, Nov 26, 2017 at 3:53 PM, Rustom Mody <rustompmody at gmail.com> wrote:
> On Sunday, November 26, 2017 at 3:43:29 AM UTC+5:30, Chris Angelico wrote:
>> On Sun, Nov 26, 2017 at 9:05 AM,  wojtek.mula wrote:
>> > Hi, my goal is to obtain an interpreter that internally
>> > uses UCS-2. Such a simple code should print 65535:
>> >
>> >   import sys
>> >   print sys.maxunicode
>> >
>> > This is enabled in Windows, but I want the same in Linux.
>> > What options have I pass to the configure script?
>>
>> Why do you want to? What useful value do you have in creating this
>> buggy interpreter?
>
> I see that you are familiar with this bug: https://bugs.python.org/issue13153
>
> And I see it or something very close is still buggy in python 3.5
> [No it does not allow me to paste an SMP char but if I open a file containing
> one it crashes and rather messily — no way to close the idle other than killing
> the shell]
>
> No thats not a diatribe against idle; just that its reasonable to want python
> to support work-arounds for reasonably common bugs in the current unicode-ecosystem

No, that issue is about IDLE (and, AIUI, is actually a Tcl/Tk
limitation). I'm talking about how Windows Pythons up to 3.2 could
take a single character and treat it as two, or could reverse a string
and make it actually not contain code points any more, or get all the
subscripts off by one (or more than one). That didn't happen on the
Linux builds. They had the lesser problem that all strings consumed
large amounts of memory.

As of Python 3.3, neither problem exists on either platform. You can't
compile them back in.

ChrisA



More information about the Python-list mailing list