Apache Mod-Python - Re: SSI crashes on Win32.

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > May 2006 > Re: SSI crashes on Win32.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: SSI crashes on Win32.
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)

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com