[4suite] 4Suite Reliance on ENVIRONMENT & global variables

Mongryong Mongryong at sympatico.ca
Mon Jan 20 23:52:10 EST 2003


Well, the new changes form the 4Suite CVS did not help.

Right now, I'm testing mod_python against a modified version of your "I
don't like spam" tutorial example.  It's attached with this email.  You
may try it out at http://rezquest.cjb.net/bin/main .  The correct result
should say "I hate spam" in an XML-aware browser (Mozilla1.0.1).

The strange thing is that if I directly output the XML source without
doing any XSLT processing, the XML source appears correctly.  Somewhere
along the line where the strings are being passed from the python
libraries to the 4Suite libraries (by Py_ParseArgs..???), the strings
are being 'miscommunicated'.  

Now, it might be a Python2.2.2 issue since libxml2/libxslt from the
gnome project are having similar problems as well.  

In 4Suite, do the apps embedd the python interpretor or do the apps
start purely from a python environment? 

It might be good to check to see whether this problem still occurs other
'python embedded' application (ie. uses Py_NewInterpretor from C). I
forget, does the command-line version of python dynamically link to the
python libraries?  If so, I wonder if the command-line version of python
is doing anything special or different when it links up and initializes
the python libraries.

I'm reposting this message on to the Python mailing list to see if
anybody there can help give us a clue.

P.S Has there been any changes in Python2.2.3+ that might possibly fix
this problem?

On Mon, 2003-01-20 at 22:28, Uche Ogbuji wrote:
> On Mon, 2003-01-20 at 14:52, Mongryong wrote:
> > Hi,
> > 
> > I'm having trouble getting the latest 4Suite XML/XSLT tools to work the
> > way I want in mod_python and I know I'm not the first one to experience
> > "out-of-the-box" success.  
> > 
> > I've determined that it's an encoding issue.   Now, with a stand-alone
> > script or CGI script under Apache, 4XSLT works fine.  But under
> > mod_python (which doesn't have access to ENVIRONMENT variables), 4XSLT
> > library decodes the XML source file in a total different encoding.  XSL
> > templates (ie. <xsl:template name="blah">) are never executed because
> > the XML tag is never recognized by the XSL processor.  Hence, you get an
> > empty output.
> > 
> > I've check the default system encoding codec and it returns 'ascii' (ie.
> > sys.getdefaultencoding).  Now, it could be that the python library
> > relies on some ENVIRONMENT variable for its configuration.
> > 
> > Anybody have any ideas what 'parameters' might not be initialized
> > properly under a non-CGI or non-shell environment such as mod_python? 
> > Or, is there a parameter that one can set to change the XML input
> > decoding?  
> 
> I don't think there is any environment variable that could affect this.
> 
> However, there have been a lot of fixes recently, including to some
> endianness bugs.  Do you mind trying again with latest 4Suite CVS and
> telling us if it helps?  Either wait till tomorrow's snapshot, or check
> out current CVS HEAD directly
> 
> http://4suite.org/docs/4SuiteCVS.xml
> 
> If it doesn't help, I hope you'll be able to help us work with you to
> find a solution for mod_python users.
> 
> -- 
> Uche Ogbuji                                    Fourthought, Inc.
> http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
> Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html
> 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4suite5-i/
> XML class warfare - http://www.adtmag.com/article.asp?id=6965
> MusicBrainz  metadata - http://www-106.ibm.com/developerworks/xml/library/x-think14.html
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.py
Type: text/x-python
Size: 1284 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030120/5ed172d3/attachment.py>


More information about the Python-list mailing list