| Graham Dumpleton 2006-05-09, 1:12 am |
| Graham Dumpleton wrote ..
> Graham Dumpleton wrote ..
>
> 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)
|