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
5cfb05ee
Kaydet (Commit)
5cfb05ee
authored
Tem 27, 2004
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added a new fileno() method. ZODB's repozo.py wants this so it can
apply os.fsync() to the GzipFile backup files it creates.
üst
fe393f47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
gzip.py
Lib/gzip.py
+9
-1
test_gzip.py
Lib/test/test_gzip.py
+9
-1
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/gzip.py
Dosyayı görüntüle @
5cfb05ee
...
@@ -5,7 +5,7 @@ but random access is not allowed."""
...
@@ -5,7 +5,7 @@ but random access is not allowed."""
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
import
struct
,
sys
,
time
import
os
,
struct
,
sys
,
time
import
zlib
import
zlib
import
__builtin__
import
__builtin__
...
@@ -334,6 +334,14 @@ class GzipFile:
...
@@ -334,6 +334,14 @@ class GzipFile:
def
flush
(
self
):
def
flush
(
self
):
self
.
fileobj
.
flush
()
self
.
fileobj
.
flush
()
def
fileno
(
self
):
"""Invoke the underlying file object's fileno() method.
This will raise AttributeError if the underlying file object
doesn't support fileno().
"""
return
self
.
fileobj
.
fileno
()
def
isatty
(
self
):
def
isatty
(
self
):
return
False
return
False
...
...
Lib/test/test_gzip.py
Dosyayı görüntüle @
5cfb05ee
...
@@ -16,8 +16,16 @@ data2 = """/* zlibmodule.c -- gzip-compatible data compression */
...
@@ -16,8 +16,16 @@ data2 = """/* zlibmodule.c -- gzip-compatible data compression */
/* See http://www.winimage.com/zLibDll for Windows */
/* See http://www.winimage.com/zLibDll for Windows */
"""
"""
f
=
gzip
.
GzipFile
(
filename
,
'wb'
)
;
f
.
write
(
data1
*
50
)
;
f
.
close
()
f
=
gzip
.
GzipFile
(
filename
,
'wb'
)
;
f
.
write
(
data1
*
50
)
# Try flush and fileno.
f
.
flush
()
f
.
fileno
()
if
hasattr
(
os
,
'fsync'
):
os
.
fsync
(
f
.
fileno
())
f
.
close
()
# Try reading.
f
=
gzip
.
GzipFile
(
filename
,
'r'
)
;
d
=
f
.
read
()
;
f
.
close
()
f
=
gzip
.
GzipFile
(
filename
,
'r'
)
;
d
=
f
.
read
()
;
f
.
close
()
verify
(
d
==
data1
*
50
)
verify
(
d
==
data1
*
50
)
...
...
Misc/NEWS
Dosyayı görüntüle @
5cfb05ee
...
@@ -46,6 +46,10 @@ Extension modules
...
@@ -46,6 +46,10 @@ Extension modules
Library
Library
-------
-------
-
gzip
.
GzipFile
has
a
new
fileno
()
method
,
to
retrieve
the
handle
of
the
underlying
file
object
(
provided
it
has
a
fileno
()
method
).
This
is
needed
if
you
want
to
use
os
.
fsync
()
on
a
GzipFile
.
-
imaplib
has
two
new
methods
:
deleteacl
and
myrights
.
-
imaplib
has
two
new
methods
:
deleteacl
and
myrights
.
-
nntplib
has
two
new
methods
:
description
and
descriptions
.
They
-
nntplib
has
two
new
methods
:
description
and
descriptions
.
They
...
...
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