Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-29 Thread Serhiy Storchaka

26.11.17 21:46, wojtek.m...@gmail.com пише:

On Sunday, November 26, 2017 at 1:00:19 AM UTC+1, Terry Reedy wrote:

You must be trying to compile 2.7.  There may be Linux distributions
that compile this way.


You're right, I need 2.7. Any hint which distro has got these settings?


UCS-2 is used by default. Most Linux distributions build Python with 
UCS-4, but you don't need to change the defaults for building a narrow 
Unicode build.


--
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-29 Thread Matt Wheeler
On Sun, 26 Nov 2017, 19:46 ,  wrote:

> On Sunday, November 26, 2017 at 1:00:19 AM UTC+1, Terry Reedy wrote:
> I have to fix a bug in my C extension that appears only in UCS-2 python
> (i.e. Windows). I can reboot to Windows and debug there, but it's pain
> in a neck for various reasons.
>

In my opinion if you want to fix a bug that shows up only on Windows, you
need to test it on Windows.

It's likely that you're right and a narrow build of python 2 on Linux will
expose and enable you to debug the same issue, but have you ruled out the
possibility of any other cross-platform incompatibilities playing a part?

> --

--
Matt Wheeler
http://funkyh.at
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-27 Thread nospam . nospam . nospam . Rustom Mody
Mody)

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

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-27 Thread wojtek mula
On Sunday, November 26, 2017 at 1:00:19 AM UTC+1, Terry Reedy wrote:
> You must be trying to compile 2.7.  There may be Linux distributions
> that compile this way.

You're right, I need 2.7. Any hint which distro has got these settings?

> If you want to seriously work with unicode, many recommend using modern
> Python.

I have to fix a bug in my C extension that appears only in UCS-2 python (i.e.
Windows). I can reboot to Windows and debug there, but it's pain in a neck for
various reasons.

w.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . nospam . Rustom Mody
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

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . nospam . Ned Batchelder
On 11/25/17 5:05 PM, wojtek.m...@gmail.com 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?
>

You say you want Python 3, but you also say you have maxunicode == 65535 on
Windows.â  That must be Python 2.â  Python 3 always has maxunicode == 1114111.

Can you say more about what you need to do?

--Ned.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . nospam . Terry Reedy
On 11/25/2017 5:12 PM, Chris Angelico wrote:
> On Sun, Nov 26, 2017 at 9:05 AM,   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?

You must be trying to compile 2.7.  There may be Linux distributions that
compile this way.  If you want to use, or ever encounter, non-BMP chars, using
surrogate pairs is problematical.  By my reading of the official UCS-2 docs,
Python's old 16-bit unicode implementation is not fully compliant.  Others have
 claimed that is it not a UCS-2 implementation.

> Why do you want to? What useful value do you have in creating this
> buggy interpreter?

> Ever since Python 3.3, that has simply not been an
> option. The bug has been solved.

If you want to seriously work with unicode, many recommend using modern Python.

--
Terry Jan Reedy

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . nospam . Chris Angelico
On Sun, Nov 26, 2017 at 10:59 AM, Terry Reedy  wrote:
> On 11/25/2017 5:12 PM, Chris Angelico wrote:
>>
>> On Sun, Nov 26, 2017 at 9:05 AM,   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?
>
>
> You must be trying to compile 2.7.  There may be Linux distributions that
> compile this way.  If you want to use, or ever encounter, non-BMP chars,
> using surrogate pairs is problematical.  By my reading of the official UCS-2
> docs, Python's old 16-bit unicode implementation is not fully compliant.
> Others have claimed that is it not a UCS-2 implementation.

See subject line. OP wishes to compile Python 3 (and almost certainly not 3.1
or 3.2) with the bugginess of Python 2's narrow builds.

ChrisA

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread wxjmfauth
Le dimanche 26 novembre 2017 05:53:55 UTC+1, Rustom Mody a ÄCcritâ :
> 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

Yes, it's a little bit extraordinary, to see a language which is supposed to
work internally in a "UCS-2/UTF-16" (very quoted) mode with a graphical toolkit
 also woking in a "UCS-2/UTF-16" succeeds to raise UTF-8 errors (!).

Patches over patches over patches over pathches ... will never solve what is
wrong by design.

As semi correctly pointed, for serious Unicode works use serious tools with a
correct Unicode implementation.

There are even tools, where the following is printable:

>>>
>>> '\ud800\udc00'.isprintable()
False
>>>

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . nospam . Chris Angelico
On Sun, Nov 26, 2017 at 9:05 AM,   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? Ever since Python 3.3, that has simply not been an option. The bug
 has been solved.

ChrisA

-- 
https://mail.python.org/mailman/listinfo/python-list


Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread wojtek mula
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?

w.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread wojtek . mula
On Sunday, November 26, 2017 at 1:00:19 AM UTC+1, Terry Reedy wrote:
> You must be trying to compile 2.7.  There may be Linux distributions 
> that compile this way.

You're right, I need 2.7. Any hint which distro has got these settings?

> If you want to seriously work with unicode, many recommend using modern 
> Python.

I have to fix a bug in my C extension that appears only in UCS-2 python
(i.e. Windows). I can reboot to Windows and debug there, but it's pain
in a neck for various reasons.

w.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread wxjmfauth
Le dimanche 26 novembre 2017 05:53:55 UTC+1, Rustom Mody a ÄCcritâ :
> 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

Yes, it's a little bit extraordinary, to see a language which is supposed to
work internally in a "UCS-2/UTF-16" (very quoted) mode with a graphical toolkit
 also woking in a "UCS-2/UTF-16" succeeds to raise UTF-8 errors (!).

Patches over patches over patches over pathches ... will never solve what is
wrong by design.

As semi correctly pointed, for serious Unicode works use serious tools with a
correct Unicode implementation.

There are even tools, where the following is printable:

>>>
>>> '\ud800\udc00'.isprintable()
False
>>>

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Serhiy Storchaka
26.11.17 01:59, Terry Reedy D¿D,ÑêDµ:
> On 11/25/2017 5:12 PM, Chris Angelico wrote:
>> On Sun, Nov 26, 2017 at 9:05 AM,â   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?
>
> You must be trying to compile 2.7.â  There may be Linux distributions
> that compile this way.

UCS-2 is the default in 2.7. But most Linux distributions build it with
UCS-4.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Chris Angelico
On Sun, Nov 26, 2017 at 3:53 PM, Rustom Mody  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

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Rustom Mody
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

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Ned Batchelder
On 11/25/17 5:05 PM, wojtek.m...@gmail.com 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?
>

You say you want Python 3, but you also say you have maxunicode == 65535 on
Windows.â  That must be Python 2.â  Python 3 always has maxunicode == 1114111.

Can you say more about what you need to do?

--Ned.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Chris Angelico
On Sun, Nov 26, 2017 at 10:59 AM, Terry Reedy  wrote:
> On 11/25/2017 5:12 PM, Chris Angelico wrote:
>>
>> On Sun, Nov 26, 2017 at 9:05 AM,   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?
>
>
> You must be trying to compile 2.7.  There may be Linux distributions that
> compile this way.  If you want to use, or ever encounter, non-BMP chars,
> using surrogate pairs is problematical.  By my reading of the official UCS-2
> docs, Python's old 16-bit unicode implementation is not fully compliant.
> Others have claimed that is it not a UCS-2 implementation.

See subject line. OP wishes to compile Python 3 (and almost certainly not 3.1
or 3.2) with the bugginess of Python 2's narrow builds.

ChrisA

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Terry Reedy
On 11/25/2017 5:12 PM, Chris Angelico wrote:
> On Sun, Nov 26, 2017 at 9:05 AM,   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?

You must be trying to compile 2.7.  There may be Linux distributions that
compile this way.  If you want to use, or ever encounter, non-BMP chars, using
surrogate pairs is problematical.  By my reading of the official UCS-2 docs,
Python's old 16-bit unicode implementation is not fully compliant.  Others have
 claimed that is it not a UCS-2 implementation.

> Why do you want to? What useful value do you have in creating this
> buggy interpreter?

> Ever since Python 3.3, that has simply not been an
> option. The bug has been solved.

If you want to seriously work with unicode, many recommend using modern Python.

--
Terry Jan Reedy

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Chris Angelico
On Sun, Nov 26, 2017 at 9:05 AM,   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? Ever since Python 3.3, that has simply not been an option. The bug
 has been solved.

ChrisA

-- 
https://mail.python.org/mailman/listinfo/python-list


Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread wojtek mula
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?

w.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-25 Thread Serhiy Storchaka

26.11.17 01:59, Terry Reedy пише:

On 11/25/2017 5:12 PM, Chris Angelico wrote:

On Sun, Nov 26, 2017 at 9:05 AM,   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?


You must be trying to compile 2.7.  There may be Linux distributions 
that compile this way.


UCS-2 is the default in 2.7. But most Linux distributions build it with 
UCS-4.


--
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-25 Thread Chris Angelico
On Sun, Nov 26, 2017 at 3:53 PM, Rustom Mody  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
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-25 Thread Rustom Mody
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
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-25 Thread Ned Batchelder

On 11/25/17 5:05 PM, wojtek.m...@gmail.com 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?



You say you want Python 3, but you also say you have maxunicode == 65535 
on Windows.  That must be Python 2.  Python 3 always has maxunicode == 
1114111.


Can you say more about what you need to do?

--Ned.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-25 Thread Chris Angelico
On Sun, Nov 26, 2017 at 10:59 AM, Terry Reedy  wrote:
> On 11/25/2017 5:12 PM, Chris Angelico wrote:
>>
>> On Sun, Nov 26, 2017 at 9:05 AM,   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?
>
>
> You must be trying to compile 2.7.  There may be Linux distributions that
> compile this way.  If you want to use, or ever encounter, non-BMP chars,
> using surrogate pairs is problematical.  By my reading of the official UCS-2
> docs, Python's old 16-bit unicode implementation is not fully compliant.
> Others have claimed that is it not a UCS-2 implementation.

See subject line. OP wishes to compile Python 3 (and almost certainly
not 3.1 or 3.2) with the bugginess of Python 2's narrow builds.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-25 Thread Terry Reedy

On 11/25/2017 5:12 PM, Chris Angelico wrote:

On Sun, Nov 26, 2017 at 9:05 AM,   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?


You must be trying to compile 2.7.  There may be Linux distributions 
that compile this way.  If you want to use, or ever encounter, non-BMP 
chars, using surrogate pairs is problematical.  By my reading of the 
official UCS-2 docs, Python's old 16-bit unicode implementation is not 
fully compliant.  Others have claimed that is it not a UCS-2 implementation.



Why do you want to? What useful value do you have in creating this
buggy interpreter?



Ever since Python 3.3, that has simply not been an
option. The bug has been solved.


If you want to seriously work with unicode, many recommend using modern 
Python.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-25 Thread Chris Angelico
On Sun, Nov 26, 2017 at 9:05 AM,   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? Ever since Python 3.3, that has simply not been an
option. The bug has been solved.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Compile Python 3 interpreter to force 2-byte unicode

2017-11-25 Thread wojtek . mula
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?

w.
-- 
https://mail.python.org/mailman/listinfo/python-list