[mod_python] PythonOption and req.get_options()

Joshua Ginsberg listspam at flowtheory.net
Mon Jun 13 13:12:06 EDT 2005

I must be missing something totally obvious here...

I've got the base path and base URL for my application defined in 
httpd.conf as a PythonOption directive:

     PythonOption baseURL http://foo.bar.tld/path/to/app/
     PythonOption basePath "/var/www/html/path/to/app/"

And then in my PSP code, I'm opening a pickle file based on that 
basePath directive:

pyOptions = req.get_options()
pckPath = pyOptions['basePath']+'signup_data.pck'
ifs = open(pckPath)

However, I get the following error:

   File "/var/www/network/jag/signup/dnq.psp", line 9, in ?
     ifs = open('signup_data.pck')

IOError: [Errno 2] No such file or directory: 'signup_data.pck'

So I thought "Hmm... let me see what the value of pyOptions is... so I 
changed my code:

pyOptions = req.get_options()
pckPath = pyOptions['basePath']+'signup_data.pck'
ifs = open(pckPath)

And then the pickle file gets opened and it throws an error from 120 
lines further into the PSP file because I called psp.redirect and had 
already returned headers to print my options table. Oh, and the options 
table is printed with the correct values.

What am I missing? FC2 system with mod_python-3.1.3-1.fc2.2 from RPM. 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: unknown.jpg
Type: image/jpeg
Size: 1984 bytes
Desc: not available
Url : http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050613/6867cbd1/unknown.jpg
-------------- next part --------------

Joshua Ginsberg -- joshg at brainstorminternet.net
Brainstorm Internet Network Operations
970-247-1442 x131

More information about the Mod_python mailing list