Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
4dbc95e2
Kaydet (Commit)
4dbc95e2
authored
Agu 02, 2013
tarafından
Larry Hastings
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #17899: Fix rare file descriptor leak in os.listdir().
üst
ffff7631
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
NEWS
Misc/NEWS
+2
-0
posixmodule.c
Modules/posixmodule.c
+12
-2
No files found.
Misc/NEWS
Dosyayı görüntüle @
4dbc95e2
...
@@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1?
...
@@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #17899: Fix rare file descriptor leak in os.listdir().
- Issue #10241: Clear extension module dict copies at interpreter shutdown.
- Issue #10241: Clear extension module dict copies at interpreter shutdown.
Patch by Neil Schemenauer, minimally modified.
Patch by Neil Schemenauer, minimally modified.
...
...
Modules/posixmodule.c
Dosyayı görüntüle @
4dbc95e2
...
@@ -3420,12 +3420,13 @@ exit:
...
@@ -3420,12 +3420,13 @@ exit:
static
PyObject
*
static
PyObject
*
_posix_listdir
(
path_t
*
path
,
PyObject
*
list
)
_posix_listdir
(
path_t
*
path
,
PyObject
*
list
)
{
{
int
fd
=
-
1
;
PyObject
*
v
;
PyObject
*
v
;
DIR
*
dirp
=
NULL
;
DIR
*
dirp
=
NULL
;
struct
dirent
*
ep
;
struct
dirent
*
ep
;
int
return_str
;
/* if false, return bytes */
int
return_str
;
/* if false, return bytes */
#ifdef HAVE_FDOPENDIR
int
fd
=
-
1
;
#endif
errno
=
0
;
errno
=
0
;
#ifdef HAVE_FDOPENDIR
#ifdef HAVE_FDOPENDIR
...
@@ -3467,6 +3468,13 @@ _posix_listdir(path_t *path, PyObject *list)
...
@@ -3467,6 +3468,13 @@ _posix_listdir(path_t *path, PyObject *list)
if
(
dirp
==
NULL
)
{
if
(
dirp
==
NULL
)
{
list
=
path_error
(
path
);
list
=
path_error
(
path
);
#ifdef HAVE_FDOPENDIR
if
(
fd
!=
-
1
)
{
Py_BEGIN_ALLOW_THREADS
close
(
fd
);
Py_END_ALLOW_THREADS
}
#endif
goto
exit
;
goto
exit
;
}
}
if
((
list
=
PyList_New
(
0
))
==
NULL
)
{
if
((
list
=
PyList_New
(
0
))
==
NULL
)
{
...
@@ -3509,8 +3517,10 @@ _posix_listdir(path_t *path, PyObject *list)
...
@@ -3509,8 +3517,10 @@ _posix_listdir(path_t *path, PyObject *list)
exit:
exit:
if
(
dirp
!=
NULL
)
{
if
(
dirp
!=
NULL
)
{
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_FDOPENDIR
if
(
fd
>
-
1
)
if
(
fd
>
-
1
)
rewinddir
(
dirp
);
rewinddir
(
dirp
);
#endif
closedir
(
dirp
);
closedir
(
dirp
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment