Graham Dumpleton wrote ..
> Graham Dumpleton wrote ..
> > >   * Testing server side include
> > > F
> > 
> > Based on the logs below, this may be what I suspected. That is there
> > is some issue with CR/LF differences on Win32 which causing the
> > code some grief. Because of the crash by Apache when exception
> > occurred in SSI code, real issue was probably being masked. I'll
> > do some more playing with CR/LF differences on UNIX and see if
> > I can recreate it.
> > 
> > BTW, when I first add ssi.shtml to subversion, I didn't set eol:native
> > property. It was added by someone later but probably after you checked
> > it out. Not sure if you need to remove that file and check it out again
> > to ensure things okay. But then, in release tar ball it is always going
> > to be be UNIX style EOLs anyway.
> 
> Yep, have recreated it by adding CR/LF explicitly in ssi.shtml. Am going
> to have to work out how to get Python to cope with it if on Win32 what
> Apache provides is going to have CR/LF in it.
> 
> If someone understands issue, happy to hear of any suggestions. :-)

Follow patch avoids problem,  but what are the implications of doing a
global replacement of CRLF with LF in Python code?

Index: lib/python/mod_python/apache.py
===================================================================
--- lib/python/mod_python/apache.py     (revision 405197)
+++ lib/python/mod_python/apache.py     (working copy)
@@ -449,7 +449,7 @@
 
             filter.req.ssi_globals["__file__"] = filter.req.filename
 
-            code = code.rstrip()
+            code = code.replace('\r\n', '\n').rstrip()
 
             if tag == 'eval':
                 result = eval(code, filter.req.ssi_globals)
Index: lib/python/mod_python/importer.py
===================================================================
--- lib/python/mod_python/importer.py   (revision 405197)
+++ lib/python/mod_python/importer.py   (working copy)
@@ -1378,7 +1378,7 @@
             filter.req.ssi_globals["__info__"] = _InstanceInfo(
                     None, filter.req.filename, None)
 
-            code = code.rstrip()
+            code = code.replace('\r\n', '\n').rstrip()
 
             if tag == 'eval':
                 result = eval(code, filter.req.ssi_globals)

Reply via email to