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
638cee62
Kaydet (Commit)
638cee62
authored
Eki 28, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #9295: Fix a crash under Windows when calling close() on a file
object with custom buffering from two threads at once.
üst
658370e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
NEWS
Misc/NEWS
+3
-0
fileobject.c
Objects/fileobject.c
+6
-0
No files found.
Misc/NEWS
Dosyayı görüntüle @
638cee62
...
...
@@ -63,6 +63,9 @@ Core and Builtins
Library
-------
- Issue #9295: Fix a crash under Windows when calling close() on a file
object with custom buffering from two threads at once.
- Issue #5027: The standard ``xml`` namespace is now understood by
xml.sax.saxutils.XMLGenerator as being bound to
http://www.w3.org/XML/1998/namespace. Patch by Troy J. Farrell.
...
...
Objects/fileobject.c
Dosyayı görüntüle @
638cee62
...
...
@@ -423,6 +423,7 @@ close_the_file(PyFileObject *f)
int
sts
=
0
;
int
(
*
local_close
)(
FILE
*
);
FILE
*
local_fp
=
f
->
f_fp
;
char
*
local_setbuf
=
f
->
f_setbuf
;
if
(
local_fp
!=
NULL
)
{
local_close
=
f
->
f_close
;
if
(
local_close
!=
NULL
&&
f
->
unlocked_count
>
0
)
{
...
...
@@ -446,10 +447,15 @@ close_the_file(PyFileObject *f)
* called. */
f
->
f_fp
=
NULL
;
if
(
local_close
!=
NULL
)
{
/* Issue #9295: must temporarily reset f_setbuf so that another
thread doesn't free it when running file_close() concurrently.
Otherwise this close() will crash when flushing the buffer. */
f
->
f_setbuf
=
NULL
;
Py_BEGIN_ALLOW_THREADS
errno
=
0
;
sts
=
(
*
local_close
)(
local_fp
);
Py_END_ALLOW_THREADS
f
->
f_setbuf
=
local_setbuf
;
if
(
sts
==
EOF
)
return
PyErr_SetFromErrno
(
PyExc_IOError
);
if
(
sts
!=
0
)
...
...
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