Gentoo Archives: gentoo-user

From: Helmut Jarausch <jarausch@××××××××××××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: python wide-unicode problem
Date: Sat, 22 Jan 2011 12:07:07
Message-Id: 1295697395.3501.0@numa-i
In Reply to: [gentoo-user] Re: python wide-unicode problem by walt
1 On 01/21/2011 10:14:33 PM, walt wrote:
2 > On 01/21/2011 07:48 AM, Helmut Jarausch wrote:
3 > > On 01/21/2011 04:26:09 PM, walt wrote:
4 > >> On 01/21/2011 12:13 AM, Helmut Jarausch wrote:
5 > >>> Hi,
6 > >>>
7 > >>> using Python3.1, if I say
8 > >>> import site
9 > >>>
10 > >>> I get
11 > >>>
12 > >>> File "/usr/lib64/python3.1/site.py", line 472, in setencoding
13 > >>> sys.setdefaultencoding(encoding) # Needs Python Unicode
14 > >> build !
15 > >>> ValueError: Can only set default encoding to utf-8
16 > >>>
17 > >>> But
18 > >>>
19 > >>> emerge -vp dev-lang/python-3.1.3 shows
20 > >>> USE="doc gdbm ipv6 ncurses readline sqlite ssl threads tk (wide-
21 > >>> unicode) xml -build -examples -wininst"
22 > >>>
23 > >>> Why is 'wide-unicode' in parentheses?
24 > >>
25 > >> Hm. Try using a different tool, like equery u python. Note the
26 > >> warning
27 > >> about changing that useflag.
28 > >
29 > > Thanks, unfortunately I don't understand the output
30 > > I've got
31 > > [ Legend : U - final flag setting for installation]
32 > > [ : I - package is installed with flag ]
33 > > [ Colors : set, unset ]
34 > > * Found these USE flags for dev-lang/python-3.1.3:
35 > > .....
36 > > - + wide-unicode : Enable wide Unicode implementation which uses
37 > 4-
38 > > byte
39 > > Unicode characters. Switching of this USE flag
40 > > changes ABI
41 > > of Python and requires reinstallation of many
42 > > Python
43 > > modules. (DON'T DISABLE THIS UNLESS YOU KNOW
44 > WHAT
45 > > YOU'RE
46 > > DOING)
47 > >
48 > > So, I have U- but I+ on wide-unicode
49 > > What does that mean?
50 >
51 > I just re-emerged python:3.1 as a test, and I see exactly the same
52 > but
53 > I don't get that error.
54 >
55 > For some reason site.py certainly thinks your python3 is built
56 > without
57 > wide-unicode. Have you tried re-installing python3 just for fun?
58 >
59 > You could try deleting site.pyc and site.pyo as an easy test.
60 >
61
62 Thanks Walt,
63 I've noticed that my root account did use an ASCII locale. Now I've
64 changed that to the same locale en_US.iso88591 that is used in non-root
65 accounts on my machine. With that I rebuild Python3.1.
66 And now, the error is gone. A bit strange.
67 I came along this problem when I tried to emerge the new
68 package app-portage/smart-live-rebuild
69 This fails because the author's name contain non-ascii (even non
70 latin1) characters. The author (Michał Górny) sent me a patch to
71 distutils.eclass and after generating an utf-8 locale
72 LANG=en_US.utf-8 emerge -v app-portage/smart-live-rebuild
73 finally succeeded. He says, it's a Python problem.
74
75 Have a nice weekend,
76 Helmut.