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
1c873bf7
Kaydet (Commit)
1c873bf7
authored
Eyl 30, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
clear BufferedRWPair weakrefs on deallocation (closes #22517)
üst
f8c4b3a7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
test_io.py
Lib/test/test_io.py
+6
-0
NEWS
Misc/NEWS
+3
-0
bufferedio.c
Modules/_io/bufferedio.c
+2
-0
No files found.
Lib/test/test_io.py
Dosyayı görüntüle @
1c873bf7
...
@@ -1474,6 +1474,12 @@ class BufferedRWPairTest(unittest.TestCase):
...
@@ -1474,6 +1474,12 @@ class BufferedRWPairTest(unittest.TestCase):
pair
=
self
.
tp
(
SelectableIsAtty
(
True
),
SelectableIsAtty
(
True
))
pair
=
self
.
tp
(
SelectableIsAtty
(
True
),
SelectableIsAtty
(
True
))
self
.
assertTrue
(
pair
.
isatty
())
self
.
assertTrue
(
pair
.
isatty
())
def
test_weakref_clearing
(
self
):
brw
=
self
.
tp
(
self
.
MockRawIO
(),
self
.
MockRawIO
())
ref
=
weakref
.
ref
(
brw
)
brw
=
None
ref
=
None
# Shouldn't segfault.
class
CBufferedRWPairTest
(
BufferedRWPairTest
):
class
CBufferedRWPairTest
(
BufferedRWPairTest
):
tp
=
io
.
BufferedRWPair
tp
=
io
.
BufferedRWPair
...
...
Misc/NEWS
Dosyayı görüntüle @
1c873bf7
...
@@ -29,6 +29,9 @@ Core and Builtins
...
@@ -29,6 +29,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
22517
:
When
a
io
.
BufferedRWPair
object
is
deallocated
,
clear
its
weakrefs
.
-
Issue
#
10510
:
distutils
register
and
upload
methods
now
use
HTML
standards
-
Issue
#
10510
:
distutils
register
and
upload
methods
now
use
HTML
standards
compliant
CRLF
line
endings
.
compliant
CRLF
line
endings
.
...
...
Modules/_io/bufferedio.c
Dosyayı görüntüle @
1c873bf7
...
@@ -2120,6 +2120,8 @@ static void
...
@@ -2120,6 +2120,8 @@ static void
bufferedrwpair_dealloc
(
rwpair
*
self
)
bufferedrwpair_dealloc
(
rwpair
*
self
)
{
{
_PyObject_GC_UNTRACK
(
self
);
_PyObject_GC_UNTRACK
(
self
);
if
(
self
->
weakreflist
!=
NULL
)
PyObject_ClearWeakRefs
((
PyObject
*
)
self
);
Py_CLEAR
(
self
->
reader
);
Py_CLEAR
(
self
->
reader
);
Py_CLEAR
(
self
->
writer
);
Py_CLEAR
(
self
->
writer
);
Py_CLEAR
(
self
->
dict
);
Py_CLEAR
(
self
->
dict
);
...
...
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