os.path.exists throws Exception only w/ mod_python + MySQLdb 0.9.x

L.C. deja-google at wotevah.com
Mon Dec 3 22:19:52 EST 2001


I am seeing a very curious behaviour and haven't been able to explain it.
I have apache 1.3.20 with mod_python 2.7.5 and MySQLdb 0.9.1 and if I try
the following code in a handler:

import os.path
os.path.exists( "/tmp/nonexistentpath" )

It throws an Error:
[Errno 2] No such file or directory: '/tmp/nonexistentpath'

The code works fine outside of apache, and what confuses me is that it
works fine with an older version of MySQLdb (0.3.x) but not with 0.9.x.

If I create the directory in question exists() returns 1 as expected.

--
L.C.



More information about the Python-list mailing list