|
Graham Dumpleton
grahamd at dscpl.com.au
Mon Jul 24 18:19:47 EDT 2006
Antonis Christofides wrote ..
> Hi,
>
> I'm trying to run moinmoin on mod_python 2.7.10, python 2.3.5, apache
> 1.3.36, on a NetBSD. I get the error on the subject when it's running
> the following code (in the line marked with "=>"):
>
> sys.stderr.write(str(env)+"\n")
> sys.stderr.write(env["HTTP_ACCEPT_LANGUAGE"]+"\n")
> sys.stderr.write(self.http_accept_language+"\n")
> => sys.stderr.write(env.get('HTTP_ACCEPT_LANGUAGE',self.http_accept_language))
>
> (In fact the original code said the following:
> self.http_accept_language = env.get('HTTP_ACCEPT_LANGUAGE',
> self.http_accept_language)
> but I inserted the four lines before that to see what's in the
> variables.
> )
>
> The output in the log file is:
> {'UNIQUE_ID': 'RMThtFLFptoAAB6zB5o', 'SERVER_SOFTWARE': 'Apache/1.3.36
> (Unix) mod_gzip/1.3.26.1a mod_python/2.7.10 Python/2.3.5', [...snip...]
> 'HTTP_ACCEPT_LANGUAGE': 'el,en-us;q=0.7,en;q=0.3', [...snip...] }
> el,en-us;q=0.7,en;q=0.3
> en
> [Mon Jul 24 17:05:24 2006] SystemError: error return without exception
> set
>
> So, as I understand, env.get(...) should return "el,en-us;q=0.7,en;q=0.3".
>
> You have any clue what to check next? Thanks!
How is your specific problem linked to mod_python itself? What is "env", is it
an object created by mod_python or by something else?
BTW, you shouldn't use sys.stderr to output logging under mod_python anyway.
You should use mod_python.apache.log_error(). Using sys.stderr is not gauranteed
to actually produce anything in the Apache log in a timely fashion.
Graham
|