Created on 2008-08-02 19:11 by fabioz, last inverse 2022-04-eleven 14:56 by admin. This issue is at present closed.
msg70638 - (view) | Author: Fabio Zadrozny (fabioz) * | Date: 2008-08-02 19:11 |
A problems has been reported against pydev complaining about os.listdir() failing while debugging (with a unicode path). The link for that is: http://sourceforge.net/tracker/index.php?func=detail&aid=2012138&group_id=85796&atid=577329 After trying to discover its cause, it appears that pydev is exercising a python issues (which is reproduced in the file attached). I have no idea why that's happening. I've reproduced it in python 2.4 and python 2.5 under ubuntu 6.ten, but I believe it happens on other versions likewise -- the original problems was reported in Ubuntu 8.04 AMD64 Hardy Heron) |
msg71330 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * | Appointment: 2008-08-18 thirteen:36 |
I practice not reproduce the trouble, but in your example, the trace function is called only when the script has finished, i.due east during interpreter shutdown. Creating a thread from at that place is non recommended... Tin can yous provide the complete traceback of your error? |
msg71362 - (view) | Writer: Fabio Zadrozny (fabioz) * | Engagement: 2008-08-18 18:55 |
I've pasted the output below... as well, the trace part is chosen for each function call after the settrace (not merely in interpreter shutdown) -- and the error happens in the listdir -- which is in the main thread, so, it must happen before the interpreter shutdown. As well, one matter: it works if y'all read an empty binder... And putting: "impress frame.f_code.co_filename, frame.f_lineno" in the 'func', information technology'll go along and print /usr/lib/python2.iv/encodings/utf_8.py 15 /usr/lib/python2.4/encodings/utf_8.py 16 /usr/lib/python2.4/encodings/utf_8.py sixteen For each file/dir bachelor (and then, it seems it's actually able to get on and get all the contents, only before returning, that exception is thrown) Output from running it: ----------------------------------------- /usr/bin/python Traceback (most recent call last): File "/home/fabioz/test workspace with spaces/test project/src/mod1/mod2/listdir_problem.py", line 23, in ? impress listdir(dir) OSError: [Errno 11] Resource temporarily unavailable: '/habitation/fabioz/jython' |
msg71377 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * | Date: 2008-08-18 21:06 |
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 earlier the system call. The in a higher place set could exist backported. As a workaround, I suggest to put a line like int('0') nigh the end of the trace funtion (at least after the creation of the thread) because it has the nice side-effect to reset errno. |
msg71383 - (view) | Author: Fabio Zadrozny (fabioz) * | Date: 2008-08-18 21:26 |
Cheers for looking into this... Unfortunately, I'1000 not sure I can utilise the workaround of the int('0'), as this could fix the debugger, merely if the code that'southward being debugged spawned other threads (which is pretty mutual), information technology would exist pointless, but at to the lowest degree clients that actually desire this can become that gear up and employ it to their python versions... And I call back that setting the errno to 0 in the debugger every time would brand other things misbehave, as in each python phone call it'd articulate information technology (or not? I'thousand not actually enlightened of the implications of doing then -- but if no 1 used it, it wouldn't be in that location, right?) |
msg71386 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * | Date: 2008-08-eighteen 21:43 |
> simply if the lawmaking that'south beingness debugged > spawned other threads (which is pretty common), it would be pointless, No, the trouble specifically lies in the implementation of listdir(). This function is not supposed to commonly spawn threads... this can just happen with a sys.settrace function (or a very special Py_FileSystemDefaultEncoding) > And I think that setting the errno to 0 in the debugger every time would > make other things misbehave, as in each python call it'd clear it I don't recollect and then. errno is (should be) only used shortly after the C system call which modified it. In that location is no room for the trace function to run. Call back that the python stack is often displayed on every debugging step, and this modifies errno more than once (to go the source file content) |
msg107443 - (view) | Writer: Terry J. Reedy (terry.reedy) * | Appointment: 2010-06-09 23:57 |
"The above set could be backported." Too late now. |
Appointment | User | Action | Args |
2022-04-xi fourteen:56:37 | admin | set | github: 47744 |
2010-06-09 23:57:12 | terry.reedy | set | status: open -> closed nosy: + terry.reedy messages: + msg107443 resolution: out of date |
2008-08-xviii 21:43:32 | amaury.forgeotdarc | ready | messages: + msg71386 |
2008-08-18 21:26:26 | fabioz | ready | messages: + msg71383 |
2008-08-xviii 21:06:38 | amaury.forgeotdarc | fix | letters: + msg71377 |
2008-08-18 18:55:twenty | fabioz | set | messages: + msg71362 |
2008-08-18 13:36:29 | amaury.forgeotdarc | set | nosy: + amaury.forgeotdarc messages: + msg71330 |
2008-08-02 nineteen:11:17 | fabioz | create | |
0 Response to "Spyder Debug Again Resource Temporarily Unavailable"
Post a Comment