[issue3494] "[Errno 11] Resource temporarily unavailable" while using tracing facility/threads (in linux listdir with unicode path)

Amaury Forgeot d'Arc report at bugs.python.org
Mon Aug 18 23:06:39 CEST 2008


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

I could reproduce the problem, and it appears that it is the same as
#1608818, corrected by r65037:

on posix platforms, listdir() used to check for errno only at the end of
the list; the problem is that the trace function creates a thread, and
this sets errno (harmlessly) somewhere when playing with locks.

In the python codebase, every function that checks errno should set it
to zero before the system call.
The above fix could be backported.

As a workaround, I suggest to put a line like 
   int('0')
near the end of the trace funtion (at least after the creation of the
thread) because it has the nice side-effect to reset errno.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3494>
_______________________________________


More information about the Python-bugs-list mailing list