mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Fix #883466: don't allow Unicode as arguments to quopri and uu codecs.
This commit is contained in:
parent
38f1b98cc3
commit
4cdceac760
2 changed files with 6 additions and 4 deletions
|
@ -18,7 +18,8 @@ def quopri_encode(input, errors='strict'):
|
|||
|
||||
"""
|
||||
assert errors == 'strict'
|
||||
f = StringIO(input)
|
||||
# using str() because of cStringIO's Unicode undesired Unicode behavior.
|
||||
f = StringIO(str(input))
|
||||
g = StringIO()
|
||||
quopri.encode(f, g, 1)
|
||||
output = g.getvalue()
|
||||
|
@ -33,7 +34,7 @@ def quopri_decode(input, errors='strict'):
|
|||
|
||||
"""
|
||||
assert errors == 'strict'
|
||||
f = StringIO(input)
|
||||
f = StringIO(str(input))
|
||||
g = StringIO()
|
||||
quopri.decode(f, g)
|
||||
output = g.getvalue()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue