Submitted by : SimonMichael at: 2004-03-29T15:43:30+00:00 (13 years ago)
Name :
Category : Severity : Status :
Optional subject :  
Optional comment :

Moved from #392 getlocale ValueError: unknown locale prevents Zwiki product initialization

hmmm...zwiki 0.27.1 --Sat, 07 Feb 2004 01:10:41 -0800 reply

Don't know if this is the right place, but on a zope 2.7rc3, python 2.3.3 server get the following when I try to install zwiki 0.27.1:

File "/var/zope-sites/z27test/Products/ZWiki/Regexps.py", line 70, in ?
   U='|'.join([x.encode('utf8') for x in unicode(string.uppercase,encoding)])
LookupError: unknown encoding: eucJP

Same problem with zwiki 0.27.1 --Mon, 29 Mar 2004 15:08:26 -0800 reply

I continue to get this problem with 0.29rc1....:

File "/var/zope-sites/torii2/Products/ZWiki/Regexps.py", line 79, in ?
   U='|'.join([x.encode('utf8') for x in unicode(string.uppercase,encoding)])
LookupError: unknown encoding: eucJP

try this --SimonMichael, Mon, 29 Mar 2004 20:51:44 -0800 reply

I tried to install your locale here so I can test, but failed. Can you advise me ? What platform are you on ?

Otherwise, can you start a python prompt (the python that zope uses) and do what Regexps.py is doing and find out what is breaking. For example, what does this give:

import string, locale
print locale.getdefaultlocale()
lang, encoding = locale.getlocale()
print lang
print encoding
print string.uppercase
s = unicode(string.uppercase,encoding)
print s
print s[0].encode('utf8')

property change --SimonMichael, Tue, 30 Mar 2004 11:55:39 -0800 reply

Title: 'IssueNo0769? "LookupError?: unknown encoding" prevents Zwiki product initialization' => 'IssueNo0769? unicode.encode LookupError?: unknown encoding prevents Zwiki product initialization'

update --SimonMichael, Tue, 30 Mar 2004 12:08:44 -0800 reply

I was able to set a japanese locale like this:

locale.setlocale(locale.LC_ALL,('ja_jp','eucJP'))

Now I get:

python> locale.getlocale()
['ja_JP', 'eucJP']

and I can see that:

unicode(anystring, 'eucJP')

is what's breaking. Same thing with 'EUC-JP'. Is this a clear python bug, or just a misleading error message ? Does what I'm trying to do (encode string.uppercase or an ascii character as eucJP) make sense ?

PythonBugs? may have more on this.

try this --simon, Wed, 31 Mar 2004 14:39:42 -0800 reply

I'm still interested in the output of the above code on your system, but have checked in a workaround for 0.29rc2. In this situation it should now log 'Warning: unicode() LookupError? for encoding %s, WikiNames will not use the system locale' at startup and keep going.

0.29rc2 has a workaround, please test --simon, Wed, 31 Mar 2004 15:32:05 -0800 reply

Status: open => pending

property change --SimonMichael, Sat, 10 Apr 2004 12:16:03 -0700 reply

Status: pending => closed

property change --Wed, 19 May 2004 04:07:34 -0700 reply

Category: installation => documentation

**see also ** --simon, Thu, 20 May 2004 11:03:26 -0700 reply

#809 UnicodeDecodeError prevents installation.. I have moved that issue's discussion back there.

property change --simon, Thu, 20 May 2004 11:03:55 -0700 reply

Status: open => closed

property change --simon, Thu, 20 May 2004 11:07:12 -0700 reply

Title: 'IssueNo0769? unicode.encode LookupError?: unknown encoding prevents Zwiki product initialization' => 'IssueNo0769? unknown encoding: eucJP prevents Zwiki product initialization'

property change --simon, Thu, 20 May 2004 11:07:23 -0700 reply

Title: 'IssueNo0769? unknown encoding: eucJP prevents Zwiki product initialization' => 'IssueNo0769? LookupError?: unknown encoding: eucJP prevents Zwiki product initialization'

python codec or unknow codec alias --FoeNyx?, Thu, 20 May 2004 16:02:09 -0700 reply

Dunno if it can help, but here are my 2 cents :) Be sure to have all latest japanese codecs for python (http://cjkpython.i18n.org/#CJKCodecs) and look into locale.py (of python package); I didnt see any 'eucJP' alias into it but you could try to change the locale in your zope.conf to 'ja_jp.eucjp' or 'japan' or 'japanese-euc'. If you are under windows you could try 'ja_JA' but I'm not sure if it is EUC or SJIS.

presumed resolved --simon, Sat, 26 Apr 2008 12:17:20 -0700 reply

Status: open => closed