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
6c783ac1
Kaydet (Commit)
6c783ac1
authored
Şub 24, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #25913: Leading <~ is optional now in base64.a85decode() with adobe=True.
Patch by Swati Jaiswal.
üst
510addf6
205e75bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
base64.py
Lib/base64.py
+9
-4
test_base64.py
Lib/test/test_base64.py
+1
-2
NEWS
Misc/NEWS
+4
-1
No files found.
Lib/base64.py
Dosyayı görüntüle @
6c783ac1
...
...
@@ -366,10 +366,15 @@ def a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v'):
"""
b
=
_bytes_from_decode_data
(
b
)
if
adobe
:
if
not
(
b
.
startswith
(
_A85START
)
and
b
.
endswith
(
_A85END
)):
raise
ValueError
(
"Ascii85 encoded byte sequences must be bracketed "
"by {!r} and {!r}"
.
format
(
_A85START
,
_A85END
))
b
=
b
[
2
:
-
2
]
# Strip off start/end markers
if
not
b
.
endswith
(
_A85END
):
raise
ValueError
(
"Ascii85 encoded byte sequences must end "
"with {!r}"
.
format
(
_A85END
)
)
if
b
.
startswith
(
_A85START
):
b
=
b
[
2
:
-
2
]
# Strip off start/end markers
else
:
b
=
b
[:
-
2
]
#
# We have to go through this stepwise, so as to ignore spaces and handle
# special short sequences
...
...
Lib/test/test_base64.py
Dosyayı görüntüle @
6c783ac1
...
...
@@ -494,6 +494,7 @@ class BaseXYTestCase(unittest.TestCase):
eq
(
base64
.
a85decode
(
data
,
adobe
=
False
),
res
,
data
)
eq
(
base64
.
a85decode
(
data
.
decode
(
"ascii"
),
adobe
=
False
),
res
,
data
)
eq
(
base64
.
a85decode
(
b
'<~'
+
data
+
b
'~>'
,
adobe
=
True
),
res
,
data
)
eq
(
base64
.
a85decode
(
data
+
b
'~>'
,
adobe
=
True
),
res
,
data
)
eq
(
base64
.
a85decode
(
'<~
%
s~>'
%
data
.
decode
(
"ascii"
),
adobe
=
True
),
res
,
data
)
...
...
@@ -584,8 +585,6 @@ class BaseXYTestCase(unittest.TestCase):
b
"malformed"
,
adobe
=
True
)
self
.
assertRaises
(
ValueError
,
base64
.
a85decode
,
b
"<~still malformed"
,
adobe
=
True
)
self
.
assertRaises
(
ValueError
,
base64
.
a85decode
,
b
"also malformed~>"
,
adobe
=
True
)
# With adobe=False (the default), Adobe framing markers are disallowed
self
.
assertRaises
(
ValueError
,
base64
.
a85decode
,
...
...
Misc/NEWS
Dosyayı görüntüle @
6c783ac1
...
...
@@ -186,7 +186,10 @@ Core and Builtins
Library
-------
Issue
#
26186
:
Remove
an
invalid
type
check
in
importlib
.
util
.
LazyLoader
.
-
Issue
#
25913
:
Leading
``<~``
is
optional
now
in
base64
.
a85decode
()
with
adobe
=
True
.
Patch
by
Swati
Jaiswal
.
-
Issue
#
26186
:
Remove
an
invalid
type
check
in
importlib
.
util
.
LazyLoader
.
-
Issue
#
26367
:
importlib
.
__import__
()
raises
ImportError
like
builtins
.
__import__
()
when
``
level
``
is
specified
but
without
an
accompanying
...
...
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