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
026435ce
Kaydet (Commit)
026435ce
authored
Nis 15, 2017
tarafından
Xiang Zhang
Kaydeden (comit)
GitHub
Nis 15, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present (#1130)
üst
eaeda64c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
10 deletions
+22
-10
test_io.py
Lib/test/test_io.py
+1
-0
NEWS
Misc/NEWS
+4
-2
iobase.c
Modules/_io/iobase.c
+17
-8
No files found.
Lib/test/test_io.py
Dosyayı görüntüle @
026435ce
...
...
@@ -3510,6 +3510,7 @@ class MiscIOTest(unittest.TestCase):
self
.
assertRaises
(
ValueError
,
f
.
readinto1
,
bytearray
(
1024
))
self
.
assertRaises
(
ValueError
,
f
.
readline
)
self
.
assertRaises
(
ValueError
,
f
.
readlines
)
self
.
assertRaises
(
ValueError
,
f
.
readlines
,
1
)
self
.
assertRaises
(
ValueError
,
f
.
seek
,
0
)
self
.
assertRaises
(
ValueError
,
f
.
tell
)
self
.
assertRaises
(
ValueError
,
f
.
truncate
)
...
...
Misc/NEWS
Dosyayı görüntüle @
026435ce
...
...
@@ -310,12 +310,14 @@ Extension Modules
Library
-------
- bpo-30068: _io._IOBase.readlines will check if it'
s
closed
first
when
hint
is
present
.
-
bpo
-
29694
:
Fixed
race
condition
in
pathlib
mkdir
with
flags
parents
=
True
.
Patch
by
Armin
Rigo
.
-
bpo
-
29692
:
Fixed
arbitrary
unchaining
of
RuntimeError
exceptions
in
contextlib.contextmanager.
Patch by Siddharth Velankar.
contextlib
.
contextmanager
.
Patch
by
Siddharth
Velankar
.
-
bpo
-
26187
:
Test
that
sqlite3
trace
callback
is
not
called
multiple
times
when
schema
is
changing
.
Indirectly
fixed
by
switching
to
...
...
Modules/_io/iobase.c
Dosyayı görüntüle @
026435ce
...
...
@@ -643,7 +643,7 @@ _io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint)
/*[clinic end generated code: output=2f50421677fa3dea input=9400c786ea9dc416]*/
{
Py_ssize_t
length
=
0
;
PyObject
*
result
;
PyObject
*
result
,
*
it
=
NULL
;
result
=
PyList_New
(
0
);
if
(
result
==
NULL
)
...
...
@@ -658,19 +658,22 @@ _io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint)
self
,
NULL
);
if
(
ret
==
NULL
)
{
Py_DECREF
(
result
);
return
NULL
;
goto
error
;
}
Py_DECREF
(
ret
);
return
result
;
}
it
=
PyObject_GetIter
(
self
);
if
(
it
==
NULL
)
{
goto
error
;
}
while
(
1
)
{
PyObject
*
line
=
PyIter_Next
(
self
);
PyObject
*
line
=
PyIter_Next
(
it
);
if
(
line
==
NULL
)
{
if
(
PyErr_Occurred
())
{
Py_DECREF
(
result
);
return
NULL
;
goto
error
;
}
else
break
;
/* StopIteration raised */
...
...
@@ -678,8 +681,7 @@ _io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint)
if
(
PyList_Append
(
result
,
line
)
<
0
)
{
Py_DECREF
(
line
);
Py_DECREF
(
result
);
return
NULL
;
goto
error
;
}
length
+=
PyObject_Size
(
line
);
Py_DECREF
(
line
);
...
...
@@ -687,7 +689,14 @@ _io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint)
if
(
length
>
hint
)
break
;
}
Py_DECREF
(
it
);
return
result
;
error:
Py_XDECREF
(
it
);
Py_DECREF
(
result
);
return
NULL
;
}
/*[clinic input]
...
...
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