File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -419,6 +419,7 @@ Jacob Kaplan-Moss
419419Lou Kates
420420Hiroaki Kawai
421421Sebastien Keim
422+ Ryan Kelly
422423Robert Kern
423424Randall Kern
424425Magnus Kessler
Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ Core and Builtins
3030Extensions
3131----------
3232
33+ - Issue #6915: Under Windows, os.listdir() didn't release the Global
34+ Interpreter Lock around all system calls. Original patch by Ryan Kelly.
35+
3336- Issue #8524: Add a detach() method to socket objects, so as to put the
3437 socket into the closed state without closing the underlying file
3538 descriptor.
Original file line number Diff line number Diff line change @@ -1229,7 +1229,7 @@ win32_stat_w(const wchar_t* path, struct win32_stat *result)
12291229 /* FILE_FLAG_BACKUP_SEMANTICS is required to open a directory */
12301230 FILE_ATTRIBUTE_NORMAL |FILE_FLAG_BACKUP_SEMANTICS ,
12311231 NULL );
1232-
1232+
12331233 if (hFile == INVALID_HANDLE_VALUE ) {
12341234 /* Either the target doesn't exist, or we don't have access to
12351235 get a handle to it. If the former, we need to return an error.
@@ -2353,7 +2353,9 @@ posix_listdir(PyObject *self, PyObject *args)
23532353 free (wnamebuf );
23542354 return NULL ;
23552355 }
2356+ Py_BEGIN_ALLOW_THREADS
23562357 hFindFile = FindFirstFileW (wnamebuf , & wFileData );
2358+ Py_END_ALLOW_THREADS
23572359 if (hFindFile == INVALID_HANDLE_VALUE ) {
23582360 int error = GetLastError ();
23592361 if (error == ERROR_FILE_NOT_FOUND ) {
@@ -2430,7 +2432,9 @@ posix_listdir(PyObject *self, PyObject *args)
24302432 if ((d = PyList_New (0 )) == NULL )
24312433 return NULL ;
24322434
2435+ Py_BEGIN_ALLOW_THREADS
24332436 hFindFile = FindFirstFile (namebuf , & FileData );
2437+ Py_END_ALLOW_THREADS
24342438 if (hFindFile == INVALID_HANDLE_VALUE ) {
24352439 int error = GetLastError ();
24362440 if (error == ERROR_FILE_NOT_FOUND )
You can’t perform that action at this time.
0 commit comments