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
dc469454
Kaydet (Commit)
dc469454
authored
Eki 04, 2012
tarafından
Jesus Cea
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Closes #15488: Closed files keep their buffer alive
üst
279ed3cc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
test_io.py
Lib/test/test_io.py
+8
-0
NEWS
Misc/NEWS
+3
-0
bufferedio.c
Modules/_io/bufferedio.c
+5
-0
No files found.
Lib/test/test_io.py
Dosyayı görüntüle @
dc469454
...
@@ -815,6 +815,14 @@ class SizeofTest:
...
@@ -815,6 +815,14 @@ class SizeofTest:
bufio
=
self
.
tp
(
rawio
,
buffer_size
=
bufsize2
)
bufio
=
self
.
tp
(
rawio
,
buffer_size
=
bufsize2
)
self
.
assertEqual
(
sys
.
getsizeof
(
bufio
),
size
+
bufsize2
)
self
.
assertEqual
(
sys
.
getsizeof
(
bufio
),
size
+
bufsize2
)
@support.cpython_only
def
test_buffer_freeing
(
self
)
:
bufsize
=
4096
rawio
=
self
.
MockRawIO
()
bufio
=
self
.
tp
(
rawio
,
buffer_size
=
bufsize
)
size
=
sys
.
getsizeof
(
bufio
)
-
bufsize
bufio
.
close
()
self
.
assertEqual
(
sys
.
getsizeof
(
bufio
),
size
)
class
BufferedReaderTest
(
unittest
.
TestCase
,
CommonBufferedTests
):
class
BufferedReaderTest
(
unittest
.
TestCase
,
CommonBufferedTests
):
read_mode
=
"rb"
read_mode
=
"rb"
...
...
Misc/NEWS
Dosyayı görüntüle @
dc469454
...
@@ -24,6 +24,9 @@ Core and Builtins
...
@@ -24,6 +24,9 @@ Core and Builtins
- Issue #15839: Convert SystemErrors in `super()` to RuntimeErrors.
- Issue #15839: Convert SystemErrors in `super()` to RuntimeErrors.
- Issue #15448: Buffered IO now frees the buffer when closed, instead
of when deallocating.
- Issue #15846: Fix SystemError which happened when using `ast.parse()` in an
- Issue #15846: Fix SystemError which happened when using `ast.parse()` in an
exception handler on code with syntax errors.
exception handler on code with syntax errors.
...
...
Modules/_io/bufferedio.c
Dosyayı görüntüle @
dc469454
...
@@ -519,6 +519,11 @@ buffered_close(buffered *self, PyObject *args)
...
@@ -519,6 +519,11 @@ buffered_close(buffered *self, PyObject *args)
res
=
PyObject_CallMethodObjArgs
(
self
->
raw
,
_PyIO_str_close
,
NULL
);
res
=
PyObject_CallMethodObjArgs
(
self
->
raw
,
_PyIO_str_close
,
NULL
);
if
(
self
->
buffer
)
{
PyMem_Free
(
self
->
buffer
);
self
->
buffer
=
NULL
;
}
end:
end:
LEAVE_BUFFERED
(
self
)
LEAVE_BUFFERED
(
self
)
return
res
;
return
res
;
...
...
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