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
6c14f231
Kaydet (Commit)
6c14f231
authored
Kas 12, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix possible double free in TextIOWrapper.__init__ (closes #22849)
üst
dfede95a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
test_io.py
Lib/test/test_io.py
+15
-0
NEWS
Misc/NEWS
+2
-0
textio.c
Modules/_io/textio.c
+1
-1
No files found.
Lib/test/test_io.py
Dosyayı görüntüle @
6c14f231
...
@@ -2784,6 +2784,21 @@ class TextIOWrapperTest(unittest.TestCase):
...
@@ -2784,6 +2784,21 @@ class TextIOWrapperTest(unittest.TestCase):
self
.
assertFalse
(
err
)
self
.
assertFalse
(
err
)
self
.
assertEqual
(
"ok"
,
out
.
decode
()
.
strip
())
self
.
assertEqual
(
"ok"
,
out
.
decode
()
.
strip
())
def
test_issue22849
(
self
):
class
F
(
object
):
def
readable
(
self
):
return
True
def
writable
(
self
):
return
True
def
seekable
(
self
):
return
True
for
i
in
range
(
10
):
try
:
self
.
TextIOWrapper
(
F
(),
encoding
=
'utf-8'
)
except
Exception
:
pass
F
.
tell
=
lambda
x
:
0
t
=
self
.
TextIOWrapper
(
F
(),
encoding
=
'utf-8'
)
class
CTextIOWrapperTest
(
TextIOWrapperTest
):
class
CTextIOWrapperTest
(
TextIOWrapperTest
):
io
=
io
io
=
io
...
...
Misc/NEWS
Dosyayı görüntüle @
6c14f231
...
@@ -36,6 +36,8 @@ Core and Builtins
...
@@ -36,6 +36,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #22849: Fix possible double free in the io.TextIOWrapper constructor.
- Issue #12728: Different Unicode characters having the same uppercase but
- Issue #12728: Different Unicode characters having the same uppercase but
different lowercase are now matched in case-insensitive regular expressions.
different lowercase are now matched in case-insensitive regular expressions.
...
...
Modules/_io/textio.c
Dosyayı görüntüle @
6c14f231
...
@@ -1061,7 +1061,7 @@ textiowrapper_init(textio *self, PyObject *args, PyObject *kwds)
...
@@ -1061,7 +1061,7 @@ textiowrapper_init(textio *self, PyObject *args, PyObject *kwds)
}
}
/* Finished sorting out the codec details */
/* Finished sorting out the codec details */
Py_
DECREF
(
codec_info
);
Py_
CLEAR
(
codec_info
);
self
->
buffer
=
buffer
;
self
->
buffer
=
buffer
;
Py_INCREF
(
buffer
);
Py_INCREF
(
buffer
);
...
...
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