mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Rip out all codecs that can't work in a unicode/bytes world:
base64, uu, zlib, rot_13, hex, quopri, bz2, string_escape. However codecs.escape_encode() and codecs.escape_decode() still exist, as they are used for pickling str8 objects (so those two functions can go, when the str8 type is removed).
This commit is contained in:
parent
6e8fcae38f
commit
42748a8d6d
11 changed files with 6 additions and 730 deletions
|
@ -10,6 +10,8 @@ dis(pickle, out=None, memo=None, indentlevel=4)
|
|||
Print a symbolic disassembly of a pickle.
|
||||
'''
|
||||
|
||||
import codecs
|
||||
|
||||
__all__ = ['dis',
|
||||
'genops',
|
||||
]
|
||||
|
@ -318,10 +320,8 @@ def read_stringnl(f, decode=True, stripquotes=True):
|
|||
else:
|
||||
raise ValueError("no string quotes around %r" % data)
|
||||
|
||||
# I'm not sure when 'string_escape' was added to the std codecs; it's
|
||||
# crazy not to use it if it's there.
|
||||
if decode:
|
||||
data = data.decode('string_escape')
|
||||
data = codecs.escape_decode(data)[0]
|
||||
return data
|
||||
|
||||
stringnl = ArgumentDescriptor(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue