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
c618ae8e
Kaydet (Commit)
c618ae8e
authored
May 27, 2016
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #5784: wbits=0 apparently added in zlib v1.2.3.5
üst
0fdf41d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
zlib.rst
Doc/library/zlib.rst
+1
-0
test_zlib.py
Lib/test/test_zlib.py
+11
-2
No files found.
Doc/library/zlib.rst
Dosyayı görüntüle @
c618ae8e
...
...
@@ -142,6 +142,7 @@ The available exception and functions in this module are:
must include a zlib header and trailer.
* 0: Automatically determine the window size from the zlib header.
Only supported since zlib 1.2.3.5.
* −8 to −15: Uses the absolute value of *wbits* as the window size
logarithm. The input must be a raw stream with no header or trailer.
...
...
Lib/test/test_zlib.py
Dosyayı görüntüle @
c618ae8e
...
...
@@ -681,10 +681,18 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
data
=
None
def
test_wbits
(
self
):
# wbits=0 only supported since zlib v1.2.3.5
# Register "1.2.3" as "1.2.3.0"
v
=
(
zlib
.
ZLIB_RUNTIME_VERSION
+
".0"
)
.
split
(
"."
,
4
)
supports_wbits_0
=
int
(
v
[
0
])
>
1
or
int
(
v
[
0
])
==
1
\
and
(
int
(
v
[
1
])
>
2
or
int
(
v
[
1
])
==
2
and
(
int
(
v
[
2
])
>
3
or
int
(
v
[
2
])
==
3
and
int
(
v
[
3
])
>=
5
))
co
=
zlib
.
compressobj
(
level
=
1
,
wbits
=
15
)
zlib15
=
co
.
compress
(
HAMLET_SCENE
)
+
co
.
flush
()
self
.
assertEqual
(
zlib
.
decompress
(
zlib15
,
15
),
HAMLET_SCENE
)
self
.
assertEqual
(
zlib
.
decompress
(
zlib15
,
0
),
HAMLET_SCENE
)
if
supports_wbits_0
:
self
.
assertEqual
(
zlib
.
decompress
(
zlib15
,
0
),
HAMLET_SCENE
)
self
.
assertEqual
(
zlib
.
decompress
(
zlib15
,
32
+
15
),
HAMLET_SCENE
)
with
self
.
assertRaisesRegex
(
zlib
.
error
,
'invalid window size'
):
zlib
.
decompress
(
zlib15
,
14
)
...
...
@@ -698,7 +706,8 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
zlib9
=
co
.
compress
(
HAMLET_SCENE
)
+
co
.
flush
()
self
.
assertEqual
(
zlib
.
decompress
(
zlib9
,
9
),
HAMLET_SCENE
)
self
.
assertEqual
(
zlib
.
decompress
(
zlib9
,
15
),
HAMLET_SCENE
)
self
.
assertEqual
(
zlib
.
decompress
(
zlib9
,
0
),
HAMLET_SCENE
)
if
supports_wbits_0
:
self
.
assertEqual
(
zlib
.
decompress
(
zlib9
,
0
),
HAMLET_SCENE
)
self
.
assertEqual
(
zlib
.
decompress
(
zlib9
,
32
+
9
),
HAMLET_SCENE
)
dco
=
zlib
.
decompressobj
(
wbits
=
32
+
9
)
self
.
assertEqual
(
dco
.
decompress
(
zlib9
),
HAMLET_SCENE
)
...
...
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