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
85e70662
Kaydet (Commit)
85e70662
authored
Kas 07, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #22406: Fixed the uu_codec codec incorrectly ported to 3.x.
Based on patch by Martin Panter.
üst
57b96779
519114df
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
uu_codec.py
Lib/encodings/uu_codec.py
+1
-1
test_codecs.py
Lib/test/test_codecs.py
+4
-0
test_uu.py
Lib/test/test_uu.py
+22
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/encodings/uu_codec.py
Dosyayı görüntüle @
85e70662
...
@@ -54,7 +54,7 @@ def uu_decode(input, errors='strict'):
...
@@ -54,7 +54,7 @@ def uu_decode(input, errors='strict'):
data
=
binascii
.
a2b_uu
(
s
)
data
=
binascii
.
a2b_uu
(
s
)
except
binascii
.
Error
as
v
:
except
binascii
.
Error
as
v
:
# Workaround for broken uuencoders by /Fredrik Lundh
# Workaround for broken uuencoders by /Fredrik Lundh
nbytes
=
(((
ord
(
s
[
0
])
-
32
)
&
63
)
*
4
+
5
)
/
3
nbytes
=
(((
s
[
0
]
-
32
)
&
63
)
*
4
+
5
)
/
/
3
data
=
binascii
.
a2b_uu
(
s
[:
nbytes
])
data
=
binascii
.
a2b_uu
(
s
[:
nbytes
])
#sys.stderr.write("Warning: %s\n" % str(v))
#sys.stderr.write("Warning: %s\n" % str(v))
write
(
data
)
write
(
data
)
...
...
Lib/test/test_codecs.py
Dosyayı görüntüle @
85e70662
...
@@ -2571,6 +2571,10 @@ class TransformCodecTest(unittest.TestCase):
...
@@ -2571,6 +2571,10 @@ class TransformCodecTest(unittest.TestCase):
info
=
codecs
.
lookup
(
alias
)
info
=
codecs
.
lookup
(
alias
)
self
.
assertEqual
(
info
.
name
,
expected_name
)
self
.
assertEqual
(
info
.
name
,
expected_name
)
def
test_uu_invalid
(
self
):
# Missing "begin" line
self
.
assertRaises
(
ValueError
,
codecs
.
decode
,
b
""
,
"uu-codec"
)
# The codec system tries to wrap exceptions in order to ensure the error
# The codec system tries to wrap exceptions in order to ensure the error
# mentions the operation being performed and the codec involved. We
# mentions the operation being performed and the codec involved. We
...
...
Lib/test/test_uu.py
Dosyayı görüntüle @
85e70662
...
@@ -93,6 +93,28 @@ class UUTest(unittest.TestCase):
...
@@ -93,6 +93,28 @@ class UUTest(unittest.TestCase):
except
uu
.
Error
as
e
:
except
uu
.
Error
as
e
:
self
.
assertEqual
(
str
(
e
),
"No valid begin line found in input file"
)
self
.
assertEqual
(
str
(
e
),
"No valid begin line found in input file"
)
def
test_garbage_padding
(
self
):
# Issue #22406
encodedtext
=
(
b
"begin 644 file
\n
"
# length 1; bits 001100 111111 111111 111111
b
"
\x21\x2C\x5F\x5F\x5F\n
"
b
"
\x20\n
"
b
"end
\n
"
)
plaintext
=
b
"
\x33
"
# 00110011
with
self
.
subTest
(
"uu.decode()"
):
inp
=
io
.
BytesIO
(
encodedtext
)
out
=
io
.
BytesIO
()
uu
.
decode
(
inp
,
out
,
quiet
=
True
)
self
.
assertEqual
(
out
.
getvalue
(),
plaintext
)
with
self
.
subTest
(
"uu_codec"
):
import
codecs
decoded
=
codecs
.
decode
(
encodedtext
,
"uu_codec"
)
self
.
assertEqual
(
decoded
,
plaintext
)
class
UUStdIOTest
(
unittest
.
TestCase
):
class
UUStdIOTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
85e70662
...
@@ -183,6 +183,9 @@ Core and Builtins
...
@@ -183,6 +183,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
22406
:
Fixed
the
uu_codec
codec
incorrectly
ported
to
3.
x
.
Based
on
patch
by
Martin
Panter
.
-
Issue
#
17293
:
uuid
.
getnode
()
now
determines
MAC
address
on
AIX
using
netstat
.
-
Issue
#
17293
:
uuid
.
getnode
()
now
determines
MAC
address
on
AIX
using
netstat
.
Based
on
patch
by
Aivars
Kalv
ā
ns
.
Based
on
patch
by
Aivars
Kalv
ā
ns
.
...
...
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