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

Gregory (Grisha) Trubetskoy grisha at modpython.org
Wed Dec 5 17:43:39 EST 2001


This in the FAQ:

http://www.modpython.org/FAQ/faqw.py?req=all#2.3

Grisha

On 3 Dec 2001, L.C. wrote:

> 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