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
b1a54a35
Kaydet (Commit)
b1a54a35
authored
May 27, 2008
tarafından
Lars Gustäbel
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Do not close external file objects passed to tarfile.open(mode='w:bz2')
when the TarFile is closed.
üst
0902cac4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
tarfile.py
Lib/tarfile.py
+0
-1
test_tarfile.py
Lib/test/test_tarfile.py
+14
-2
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/tarfile.py
Dosyayı görüntüle @
b1a54a35
...
...
@@ -692,7 +692,6 @@ class _BZ2Proxy(object):
if
self
.
mode
==
"w"
:
raw
=
self
.
bz2obj
.
flush
()
self
.
fileobj
.
write
(
raw
)
self
.
fileobj
.
close
()
# class _BZ2Proxy
#------------------------
...
...
Lib/test/test_tarfile.py
Dosyayı görüntüle @
b1a54a35
...
...
@@ -529,7 +529,19 @@ class PaxReadTest(LongnameTest):
self
.
assertEqual
(
float
(
tarinfo
.
pax_headers
[
"ctime"
]),
1041808783.0
)
class
WriteTest
(
unittest
.
TestCase
):
class
WriteTestBase
(
unittest
.
TestCase
):
# Put all write tests in here that are supposed to be tested
# in all possible mode combinations.
def
test_fileobj_no_close
(
self
):
fobj
=
StringIO
.
StringIO
()
tar
=
tarfile
.
open
(
fileobj
=
fobj
,
mode
=
self
.
mode
)
tar
.
addfile
(
tarfile
.
TarInfo
(
"foo"
))
tar
.
close
()
self
.
assert_
(
fobj
.
closed
is
False
,
"external fileobjs must never closed"
)
class
WriteTest
(
WriteTestBase
):
mode
=
"w:"
...
...
@@ -652,7 +664,7 @@ class WriteTest(unittest.TestCase):
shutil
.
rmtree
(
tempdir
)
class
StreamWriteTest
(
unittest
.
TestC
ase
):
class
StreamWriteTest
(
WriteTestB
ase
):
mode
=
"w|"
...
...
Misc/NEWS
Dosyayı görüntüle @
b1a54a35
...
...
@@ -63,6 +63,9 @@ Extension Modules
Library
-------
- Do not close external file objects passed to tarfile.open(mode='w:bz2')
when the TarFile is closed.
- Issue #2959: For consistency with other file-like objects, gzip's
GzipFile.close() can now be called multiple times without raising
an exception.
...
...
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