diff options
author | Georg Brandl <georg@python.org> | 2007-09-03 07:16:46 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-09-03 07:16:46 (GMT) |
commit | 4cdceac76031a7b29f8b60dcffc57744b84f4db3 (patch) | |
tree | 42585409f4ae4d8620887b5da15adb37c09b4080 /Lib/encodings/uu_codec.py | |
parent | 38f1b98cc3b951ac48f606df8b633793dbf5cf5b (diff) | |
download | cpython-4cdceac76031a7b29f8b60dcffc57744b84f4db3.zip cpython-4cdceac76031a7b29f8b60dcffc57744b84f4db3.tar.gz cpython-4cdceac76031a7b29f8b60dcffc57744b84f4db3.tar.bz2 |
Fix #883466: don't allow Unicode as arguments to quopri and uu codecs.
Diffstat (limited to 'Lib/encodings/uu_codec.py')
-rw-r--r-- | Lib/encodings/uu_codec.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/encodings/uu_codec.py b/Lib/encodings/uu_codec.py index 43fb93c..fb03758 100644 --- a/Lib/encodings/uu_codec.py +++ b/Lib/encodings/uu_codec.py @@ -25,7 +25,8 @@ def uu_encode(input,errors='strict',filename='<data>',mode=0666): assert errors == 'strict' from cStringIO import StringIO from binascii import b2a_uu - infile = StringIO(input) + # using str() because of cStringIO's Unicode undesired Unicode behavior. + infile = StringIO(str(input)) outfile = StringIO() read = infile.read write = outfile.write @@ -60,7 +61,7 @@ def uu_decode(input,errors='strict'): assert errors == 'strict' from cStringIO import StringIO from binascii import a2b_uu - infile = StringIO(input) + infile = StringIO(str(input)) outfile = StringIO() readline = infile.readline write = outfile.write |