Submitted by : Simon Michael at: 2005-09-15T18:37:36+00:00 (12 years ago)
Name :
Category : Severity : Status :
Optional subject :  
Optional comment :

(new) Fwd: Zwiki conflicts with my product --Nicholas Wieland, Thu, 15 Sep 2005 18:37:39 -0700 reply

-------- Original Message -------- Subject: Zwiki conflicts with my product Date: Thu, 15 Sep 2005 12:39:04 +0200 (CEST) From: Nicholas Wieland Newsgroups: gmane.comp.web.zope.general

I've developed a FS based product, and now I'm preparing the environment to put it in production. After copying the product directory in Zope's Product folder Zope doesn't start anymore, for reasons that frankly I don't understand because it "conflicts" with Zwiki (and I don't use anything from that product).

2005-09-15T12:05:37 ERROR(200) Zope Could not import Products.ZWiki Traceback (most recent call last):

File "C:\Program

FilesZope?-2.7.7-finallibpythonOFSApplication.py", line 6 73, in import_product

product=__import__(pname, global_dict, global_dict, silly)
File "d:Zope-InstanceProductsZWiki?__init__.py", line 12, in ?
import ZWikiPage, ZWikiWeb?, Permissions, Defaults
File "d:Zope-InstanceProductsZWikiZWikiPage?.py", line 63, in ?
from Regexps import url, bracketedexpr, doublebracketedexpr,
File "d:Zope-InstanceProductsZWikiRegexps?.py", line 93, in ?
uppercase_uc = unicode(string.uppercase)

UnicodeDecodeError?: 'ascii' codec can't decode byte 0x8a in position 26: ordinal

not in range(128)
Traceback (most recent call last ):
File "C:Program

FilesZope?-2.7.7-finallibpythonZopeStartuprun.py", line 50, in ?

run()

File "C:Program

FilesZope?-2.7.7-finallibpythonZopeStartuprun.py", line 19, in run

start_zope(opts.configroot)

File "C:Program

FilesZope?-2.7.7-finallibpythonZopeStartup__init__.py", line 52, in start_zope

starter.startZope()

File "C:Program

FilesZope?-2.7.7-finallibpythonZopeStartup__init__.py", line 231, in startZope

Zope.startup()

File "C:Program FilesZope?-2.7.7-finallibpythonZope__init__.py",

line 47,
in startup
_startup()

File "C:Program

FilesZope?-2.7.7-finallibpythonZopeAppstartup.py", line 45, in startup

OFS.Application.import_products()

File "C:Program

FilesZope?-2.7.7-finallibpythonOFSApplication.py", line 6 50, in impo rt_products

import_product(product_dir, product_name, raise_exc=debug_mode)

File "C:Program

FilesZope?-2.7.7-finallibpythonOFSApplication.py", line 6 73, in import_product

product=__import__(pname, global_dict, global_dict, silly)
File "d:Zope-InstanceProductsZWiki?__init__.py", line 12, in ?
import ZWikiPage, ZWikiWeb?, Permissions, Defaults
File "d:Zope-InstanceProductsZWikiZWikiPage?.py", line 63, in ?
from Regexps import url, bracketedexpr, doublebracketedexpr,
File "d:Zope-InstanceProductsZWikiRegexps?.py", line 93, in ?
uppercase_uc = unicode(string.uppercase)

UnicodeDecodeError?: 'ascii' codec can't decode byte 0x8a in position 26: ordinal

not in range(128)

My product depends on Reportlab and PIL, nothing else, I don't have a clue of what's happening here. If I delete my product, everything's fine. If I delete Zwiki, everything's fine. I've tried various locale settings inside zope.conf, always the same error.

Zope 2.7.7 on Windows. Zwiki is 0.41.

Suggestions ?

... --Dieter Maurer, Thu, 15 Sep 2005 18:38:03 -0700 reply

-------- Original Message -------- Subject: Re: Zwiki conflicts with my product Date: Thu, 15 Sep 2005 21:04:08 +0200 From: Dieter Maurer CC: zope@zope.org Newsgroups: gmane.comp.web.zope.general References: <20050915103904.37021.qmail@web25608.mail.ukl.yahoo.com>

Nicholas Wieland wrote at 2005-9-15 12:39 +0200: > ... > from Regexps import url, bracketedexpr, doublebracketedexpr, > File "d:Zope-InstanceProductsZWikiRegexps?.py", line 93, in ? > uppercase_uc = unicode(string.uppercase) >UnicodeDecodeError?: 'ascii' codec can't decode byte 0x8a in position 26: ordinal > not in range(128)

When you set a "locale", then "string.uppercase" may contain non ascii characters -- something "ZWiki" apparently cannot handle -- please file a ZWiki bug report.

You can fix this problem locally in your code by providing the correct charset as second argument for "unicode()" in line 93 of "...ZWiki/Regexps.py".

property change --simon, Thu, 15 Sep 2005 18:40:51 -0700 reply

Category: => admin-installing Severity: => serious Status: => open

Re: Zwiki conflicts with my product --Simon Michael, Thu, 15 Sep 2005 19:36:30 -0700 reply

Hi Nicholas,

I think use of the encoding argument just failed two lines above that one, and so Dieter's suggestion may not work.

In your event log at blather severity, or on the console if you start with zopectl fg -Xdebug-mode=on, you should see:

ZWiki... Warning: unicode() LookupError for encoding ___, WikiNames

will not use the system locale

What is the encoding it reports there ? Is it trying a strange one due to your product setting the locale ? (usually not recommended, incidentally..)

It shouldn't crash of course. As a workaround you could try:

lang, encoding = None, None

at line 79. Feel free to take this to http://zwiki.org/1158 if you like.

Re: Zwiki conflicts with my product --Simon Michael, Thu, 15 Sep 2005 19:43:35 -0700 reply

> you should see:

> > ZWiki... Warning: unicode() LookupError? for encoding ___, WikiNames > will not use the system locale

Oops, I didn't get it quite right. You won't see that, but hopefully you can see how to tweak the code to find out the encoding it's attempting to use.

Solved... --Fri, 16 Sep 2005 00:17:56 -0700 reply

With a _dirty_ hack. I've changed encoding inside site.py to "ISO-8859-1", and deleted moin* inside pagetypes/. It works, but with a pair of warinings regarding an ImportError? for fit.Parse and zwiki using no i18n.

questions --simon, Thu, 22 Sep 2005 10:38:12 -0700 reply

Hi.. I'm still interested in

I've toned down the missing fit warning and clarified the missing PTS warning. We still need to rework this code in Regexps.py so it's more robust. This issue is similar to #769 and #392.

believed fixed --simon, Sat, 24 Sep 2005 11:38:45 -0700 reply

Name: '#1158 Fwd: Zwiki conflicts with my product' => '#1158 Zwiki can fail to initialise due to locale sensitivity in Regexps.py' Status: open => closed

I've rewritten the locale-aware wikinames and docs in Regexps.py for 0.46 and I believe locale issues will no longer prevent startup. Wide testing of the latest code from CodeRepos would be helpful.