[Python-checkins] r42884 - python/trunk/Modules/posixmodule.c

Thomas Heller theller at python.net
Tue Mar 7 21:31:00 CET 2006


Georg Brandl wrote:
> Thomas Heller wrote:
>> georg.brandl wrote:
>>> Author: georg.brandl
>>> Date: Tue Mar  7 13:48:03 2006
>>> New Revision: 42884
>>>
>>> Modified:
>>>    python/trunk/Modules/posixmodule.c
>>> Log:
>>> Bug #1432525: os.listdir now releases the GIL while calling
>>> readdir().
>> This checkin broke os.listdir().  It returns an empty list now in most cases,
>> on Windows XP at least.
> 
> Could you help me find the cause? I'm not able to see why this should change
> the behavior of listdir().
> 
> Georg
First, 'result' may be uninitialized in the
    do { } while(result == TRUE);
loop ending on line 1756 when the 'continue' in the loop has been executed.
Since result is not 'TRUE' in most cases, the function returns not finding
any files.

When I initialize result to TRUE at the top of the function, it gets worse.
because the 'continue' statement keeps looping forever.

Hope that helps (sorry I don't have time to fix this myself).

Thomas



More information about the Python-checkins mailing list