File access and threads

  • Thread starter =?ISO-8859-1?Q?Petter_Holmstr=F6m?=
  • Start date
?

=?ISO-8859-1?Q?Petter_Holmstr=F6m?=

Hello,

I have a problem with file access which I believe is caused by a
thread-problem. I first noticed it while trying to get PSP/Mod_Python to
work in the shape of an exception claiming that there are no usable
temporary directories.

The second time I noticed it was when I was trying to dump an object to
a file using pickle, and I got the "Bad file descriptor" error all the
time, even though the file was created in the file system.

I googled around and found out that there have been similar problems
before, and that these are due to threading, but I didn't manage to find
a solution (except to recompile Python without threads, which in my case
is not an option as I'm running Zope on the server).

Are there any tips you could give me?

I'm running Python 2.3.3 (from the Ports collection) on FreeBSD 5.2.1.

Thanks in advance,

-Petter-
 
A

Aahz

I have a problem with file access which I believe is caused by a
thread-problem. I first noticed it while trying to get PSP/Mod_Python to
work in the shape of an exception claiming that there are no usable
temporary directories.

The second time I noticed it was when I was trying to dump an object to
a file using pickle, and I got the "Bad file descriptor" error all the
time, even though the file was created in the file system.

Could you at least post a full traceback?
 
?

=?ISO-8859-1?Q?Petter_Holmstr=F6m?=

Aahz said:
Could you at least post a full traceback?

Is this enough?


=== TRACEBACK BEGINS ===
Mod_python error: "PythonHandler mod_python.psp"

Traceback (most recent call last):

File "/usr/local/lib/python2.3/site-packages/mod_python/apache.py",
line 287, in HandlerDispatch
log=debug)

File "/usr/local/lib/python2.3/site-packages/mod_python/apache.py",
line 457, in import_module
module = imp.load_module(mname, f, p, d)

File "/usr/local/lib/python2.3/site-packages/mod_python/psp.py", line
34, in ?
tempdir = tempfile.gettempdir()

File "/usr/local/lib/python2.3/tempfile.py", line 242, in gettempdir
tempdir = _get_default_tempdir()

File "/usr/local/lib/python2.3/tempfile.py", line 188, in
_get_default_tempdir
raise IOError, (_errno.ENOENT,

IOError: [Errno 2] No usable temporary directory found in ['/tmp',
'/var/tmp', '/usr/tmp', '/']

=== TRACEBACK ENDS ===

-Petter-
 
A

Aahz

Is this enough?

Looking at the code, I'd bet on a permissions problem of some kind.
It's pretty much either that or a bug in the underlying C libraries that
gets exposed by threads -- that's a dirt-simple piece of code, really.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,591
Members
45,102
Latest member
GregoryGri
Top