public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] python wide-unicode problem
@ 2011-01-21  8:13 Helmut Jarausch
  2011-01-21 15:26 ` [gentoo-user] " walt
  0 siblings, 1 reply; 5+ messages in thread
From: Helmut Jarausch @ 2011-01-21  8:13 UTC (permalink / raw
  To: gentoo-user

Hi,

using Python3.1, if I say
import site

I get

  File "/usr/lib64/python3.1/site.py", line 472, in setencoding
    sys.setdefaultencoding(encoding) # Needs Python Unicode build !
ValueError: Can only set default encoding to utf-8

But

emerge -vp dev-lang/python-3.1.3  shows
USE="doc gdbm ipv6 ncurses readline sqlite ssl threads tk (wide-
unicode) xml -build -examples -wininst"

Why is 'wide-unicode' in parentheses?
eix dev-lang/python shows
the wide-unicode use flag.

What's going on here?

Many thanks for a hint,
Helmut.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-user] Re: python wide-unicode problem
  2011-01-21  8:13 [gentoo-user] python wide-unicode problem Helmut Jarausch
@ 2011-01-21 15:26 ` walt
  2011-01-21 15:48   ` Helmut Jarausch
  0 siblings, 1 reply; 5+ messages in thread
From: walt @ 2011-01-21 15:26 UTC (permalink / raw
  To: gentoo-user

On 01/21/2011 12:13 AM, Helmut Jarausch wrote:
> Hi,
>
> using Python3.1, if I say
> import site
>
> I get
>
>    File "/usr/lib64/python3.1/site.py", line 472, in setencoding
>      sys.setdefaultencoding(encoding) # Needs Python Unicode build !
> ValueError: Can only set default encoding to utf-8
>
> But
>
> emerge -vp dev-lang/python-3.1.3  shows
> USE="doc gdbm ipv6 ncurses readline sqlite ssl threads tk (wide-
> unicode) xml -build -examples -wininst"
>
> Why is 'wide-unicode' in parentheses?

Hm.  Try using a different tool, like equery u python.  Note the warning
about changing that useflag.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] Re: python wide-unicode problem
  2011-01-21 15:26 ` [gentoo-user] " walt
@ 2011-01-21 15:48   ` Helmut Jarausch
  2011-01-21 21:14     ` walt
  0 siblings, 1 reply; 5+ messages in thread
From: Helmut Jarausch @ 2011-01-21 15:48 UTC (permalink / raw
  To: gentoo-user

On 01/21/2011 04:26:09 PM, walt wrote:
> On 01/21/2011 12:13 AM, Helmut Jarausch wrote:
> > Hi,
> >
> > using Python3.1, if I say
> > import site
> >
> > I get
> >
> >    File "/usr/lib64/python3.1/site.py", line 472, in setencoding
> >      sys.setdefaultencoding(encoding) # Needs Python Unicode 
> build !
> > ValueError: Can only set default encoding to utf-8
> >
> > But
> >
> > emerge -vp dev-lang/python-3.1.3  shows
> > USE="doc gdbm ipv6 ncurses readline sqlite ssl threads tk (wide-
> > unicode) xml -build -examples -wininst"
> >
> > Why is 'wide-unicode' in parentheses?
> 
> Hm.  Try using a different tool, like equery u python.  Note the
> warning
> about changing that useflag.

Thanks, unfortunately I don't understand the output
I've got
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for dev-lang/python-3.1.3:
.....
 - + wide-unicode : Enable wide Unicode implementation which uses 4-
byte
                    Unicode characters. Switching of this USE flag 
changes ABI
                    of Python and requires reinstallation of many 
Python
                    modules. (DON'T DISABLE THIS UNLESS YOU KNOW WHAT 
YOU'RE
                    DOING)

So, I have U- but I+ on wide-unicode
What does that mean?

Thanks,
Helmut.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-user] Re: python wide-unicode problem
  2011-01-21 15:48   ` Helmut Jarausch
@ 2011-01-21 21:14     ` walt
  2011-01-22 11:56       ` Helmut Jarausch
  0 siblings, 1 reply; 5+ messages in thread
From: walt @ 2011-01-21 21:14 UTC (permalink / raw
  To: gentoo-user

On 01/21/2011 07:48 AM, Helmut Jarausch wrote:
> On 01/21/2011 04:26:09 PM, walt wrote:
>> On 01/21/2011 12:13 AM, Helmut Jarausch wrote:
>>> Hi,
>>>
>>> using Python3.1, if I say
>>> import site
>>>
>>> I get
>>>
>>>     File "/usr/lib64/python3.1/site.py", line 472, in setencoding
>>>       sys.setdefaultencoding(encoding) # Needs Python Unicode
>> build !
>>> ValueError: Can only set default encoding to utf-8
>>>
>>> But
>>>
>>> emerge -vp dev-lang/python-3.1.3  shows
>>> USE="doc gdbm ipv6 ncurses readline sqlite ssl threads tk (wide-
>>> unicode) xml -build -examples -wininst"
>>>
>>> Why is 'wide-unicode' in parentheses?
>>
>> Hm.  Try using a different tool, like equery u python.  Note the
>> warning
>> about changing that useflag.
>
> Thanks, unfortunately I don't understand the output
> I've got
> [ Legend : U - final flag setting for installation]
> [        : I - package is installed with flag     ]
> [ Colors : set, unset                             ]
>   * Found these USE flags for dev-lang/python-3.1.3:
> .....
>   - + wide-unicode : Enable wide Unicode implementation which uses 4-
> byte
>                      Unicode characters. Switching of this USE flag
> changes ABI
>                      of Python and requires reinstallation of many
> Python
>                      modules. (DON'T DISABLE THIS UNLESS YOU KNOW WHAT
> YOU'RE
>                      DOING)
>
> So, I have U- but I+ on wide-unicode
> What does that mean?

I just re-emerged python:3.1 as a test, and I see exactly the same but
I don't get that error.

For some reason site.py certainly thinks your python3 is built without
wide-unicode.  Have you tried re-installing python3 just for fun?

You could try deleting site.pyc and site.pyo as an easy test.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] Re: python wide-unicode problem
  2011-01-21 21:14     ` walt
@ 2011-01-22 11:56       ` Helmut Jarausch
  0 siblings, 0 replies; 5+ messages in thread
From: Helmut Jarausch @ 2011-01-22 11:56 UTC (permalink / raw
  To: gentoo-user

On 01/21/2011 10:14:33 PM, walt wrote:
> On 01/21/2011 07:48 AM, Helmut Jarausch wrote:
> > On 01/21/2011 04:26:09 PM, walt wrote:
> >> On 01/21/2011 12:13 AM, Helmut Jarausch wrote:
> >>> Hi,
> >>>
> >>> using Python3.1, if I say
> >>> import site
> >>>
> >>> I get
> >>>
> >>>     File "/usr/lib64/python3.1/site.py", line 472, in setencoding
> >>>       sys.setdefaultencoding(encoding) # Needs Python Unicode
> >> build !
> >>> ValueError: Can only set default encoding to utf-8
> >>>
> >>> But
> >>>
> >>> emerge -vp dev-lang/python-3.1.3  shows
> >>> USE="doc gdbm ipv6 ncurses readline sqlite ssl threads tk (wide-
> >>> unicode) xml -build -examples -wininst"
> >>>
> >>> Why is 'wide-unicode' in parentheses?
> >>
> >> Hm.  Try using a different tool, like equery u python.  Note the
> >> warning
> >> about changing that useflag.
> >
> > Thanks, unfortunately I don't understand the output
> > I've got
> > [ Legend : U - final flag setting for installation]
> > [        : I - package is installed with flag     ]
> > [ Colors : set, unset                             ]
> >   * Found these USE flags for dev-lang/python-3.1.3:
> > .....
> >   - + wide-unicode : Enable wide Unicode implementation which uses
> 4-
> > byte
> >                      Unicode characters. Switching of this USE flag
> > changes ABI
> >                      of Python and requires reinstallation of many
> > Python
> >                      modules. (DON'T DISABLE THIS UNLESS YOU KNOW
> WHAT
> > YOU'RE
> >                      DOING)
> >
> > So, I have U- but I+ on wide-unicode
> > What does that mean?
> 
> I just re-emerged python:3.1 as a test, and I see exactly the same 
> but
> I don't get that error.
> 
> For some reason site.py certainly thinks your python3 is built 
> without
> wide-unicode.  Have you tried re-installing python3 just for fun?
> 
> You could try deleting site.pyc and site.pyo as an easy test.
> 

Thanks Walt,
I've noticed that my root account did use an ASCII locale. Now I've 
changed that to the same locale en_US.iso88591 that is used in non-root 
accounts on my machine. With that I rebuild Python3.1.
And now, the error is gone. A bit strange.
I came along this problem when I tried to emerge the new 
package app-portage/smart-live-rebuild
This fails because the author's name contain non-ascii (even non 
latin1) characters. The author (Michał Górny) sent me a patch to 
distutils.eclass and after generating an utf-8 locale
LANG=en_US.utf-8 emerge -v app-portage/smart-live-rebuild
finally succeeded. He says, it's a Python problem.

Have a nice weekend,
Helmut.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-22 12:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-21  8:13 [gentoo-user] python wide-unicode problem Helmut Jarausch
2011-01-21 15:26 ` [gentoo-user] " walt
2011-01-21 15:48   ` Helmut Jarausch
2011-01-21 21:14     ` walt
2011-01-22 11:56       ` Helmut Jarausch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox