• Guido van Rossum's avatar
    Minimal fix for the complaints about pickling Unicode objects. (SF · a31b4ef7
    Guido van Rossum yazdı
    bugs #126161 and 123634).
    
    The solution doesn't use the unicode-escape encoding; that has other
    problems (it seems not 100% reversible).  Rather, it transforms the
    input Unicode object slightly before encoding it using
    raw-unicode-escape, so that the decoding will reconstruct the original
    string: backslash and newline characters are translated into their
    \uXXXX counterparts.
    
    This is backwards incompatible for strings containing backslashes, but
    for some of those strings, the pickling was already broken.
    a31b4ef7
pickle.py 24.1 KB