[mod_python] Re: [4suite] 4Suite Reliance on ENVIRONMENT & global variables

Mongryong Mongryong at sympatico.ca
Wed Jan 22 20:51:40 EST 2003


Hey Mike, you're a GENIUS!!!  

Below are the results from two tests I did.  The first test set 
USE_MINIDOM=0.  The second test set USE_MINIDOM=1 Here's an output from
my simple little test:

Using 4Suite 0.12a CVS latest

Test#1: set USE_MINIDOM=0

Here's the result of just printing the string SOURCE:
<spam id="eggs">I don't like spam</spam>

Here's the result of printing from the SOURCE dom tree created via the
NonvalidatingReader:
<?xml version="1.0" encoding="UTF-8"?>
<灳浡 æ‘©="来獧⼀眯睷眮⸳牯⽧䵘⽌㤱ã
¹æ¸¯æµ¡ç¥æ…°æ•£">â‰æ½¤â®â´æ¥¬æ•«çŒ æ…°ã±­çŒ¯æ…°ã¹­?????</灳浡>

Here's the result of printing from the SOURCE dom tree created via
PyExpat (from PyXML 0.8.2):
<?xml version="1.0" encoding="UTF-8"?>
<spam id="eggs">I don't like spam</spam>

Here's the result of the XSLT processing (simple copy of source XML):
<?xml version="1.0" encoding="UTF-8"?>
<灳浡 æ‘©="来獧⼀眯睷眮⸳牯⽧䵘⽌㤱ã
¹æ¸¯æµ¡ç¥æ…°æ•£">â‰æ½¤â®â´æ¥¬æ•«çŒ æ…°ã±­çŒ¯æ…°ã¹­?????</灳浡>

Ft.DEFAULT_ENCODING = utf 
Ft.Xml.Domlette.MINIDOM = 0 
sys.getdefaultencoding = ascii 
local.getdefaultlocale()[1] = utf 
*******************************************
Test#2: set USE_MINIDOM=1

Here's the result of just printing the string SOURCE:
<spam id="eggs">I don't like spam</spam>

Here's the result of printing from the SOURCE dom tree created via the
NonvalidatingReader:
<?xml version="1.0" encoding="UTF-8"?>
<spam id="eggs">I don't like spam</spam>

Here's the result of printing from the SOURCE dom tree create via
PyExpat (from PyXML 0.8.2)
<?xml version="1.0" encoding="UTF-8"?>
<spam id="eggs">I don't like spam</spam>

Here's the result of the XSLT processing (simple copy of source XML): 
<?xml version="1.0" encoding="UTF-8"?>
<spam id="eggs">I don't like spam</spam>

Ft.DEFAULT_ENCODING = utf 
Ft.Xml.Domlette.MINIDOM = 1 
sys.getdefaultencoding = ascii 
local.getdefaultlocale()[1] = utf 

It appears that the encoding problem has nothing to do with PyXML
libraries.

Again, the encoding problem only occurs in an embedded application like
mod_python.  

Does 4Suite set any other ENVIRONMENT variables during its execution?

According to the mod_python documentation, any changes to the OS
environment variables after mod_python has started will not be seen by
any scripts or libraries.  That is, if I change an environment variable
from my shell console or a script changes an environment variable during
Apache's life-time, the changes will not be seen.

If the 4Suite developers could hypothesis what's going, it'd be great. 

On Wed, 2003-01-22 at 16:07, Mike Brown wrote:
> Mongryong wrote:
> > Summary of combinations that produced no 'encoding' problem:
> > Apache 1.3.27 to 2.1 CVS latest
> > mod_python 3.0.2 CVS latest
> > Python 2.2.2  
> > 4Suite 0.11.1 
> > PyXML 0.6.6
> > 
> > To me, the encoding problem appears to have something to do with 4Suite
> > 0.12.x or PyXML 0.8.x or a combination of the two.  
> 
> Unfortunately this doesn't tell us much.
> 
> 0.12.0 is almost a complete rewrite of 4Suite from 0.11.1. 0.11.1 did not use
> cDomlette by default, so my guess is that if you were using 0.11.1 and set
> BETA_DOMLETTE to 1 (I think that's how it was done... could be wrong), you
> might see the same misbehavior.
> 
> In 0.12.0, see what happens if you set USE_MINIDOM to 1 first. It'll probably 
> work (but will be slow).
> 
> Another shot int he dark -
> 
> If PyXML isn't required for mod_python, can you see what happens if you don't
> have it installed? 0.12.0 should be OK without PyXML as long as you don't need
> validation.
> 
> Mike
> 
> -- 
>   Mike J. Brown   |  http://skew.org/~mike/resume/
>   Denver, CO, USA |  http://skew.org/xml/
> _______________________________________________
> 4suite mailing list
> 4suite at lists.fourthought.com
> http://lists.fourthought.com/mailman/listinfo/4suite






More information about the Mod_python mailing list