Extensions
----------
+- Issue #6915: Under Windows, os.listdir() didn't release the Global
+ Interpreter Lock around all system calls. Original patch by Ryan Kelly.
+
- Issue #8524: Add a detach() method to socket objects, so as to put the
socket into the closed state without closing the underlying file
descriptor.
/* FILE_FLAG_BACKUP_SEMANTICS is required to open a directory */
FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS,
NULL);
-
+
if(hFile == INVALID_HANDLE_VALUE) {
/* Either the target doesn't exist, or we don't have access to
get a handle to it. If the former, we need to return an error.
free(wnamebuf);
return NULL;
}
+ Py_BEGIN_ALLOW_THREADS
hFindFile = FindFirstFileW(wnamebuf, &wFileData);
+ Py_END_ALLOW_THREADS
if (hFindFile == INVALID_HANDLE_VALUE) {
int error = GetLastError();
if (error == ERROR_FILE_NOT_FOUND) {
if ((d = PyList_New(0)) == NULL)
return NULL;
+ Py_BEGIN_ALLOW_THREADS
hFindFile = FindFirstFile(namebuf, &FileData);
+ Py_END_ALLOW_THREADS
if (hFindFile == INVALID_HANDLE_VALUE) {
int error = GetLastError();
if (error == ERROR_FILE_NOT_FOUND)