diff --git a/pickle/pickle.py b/pickle/pickle.py index 18c46ae0..6e1d93ac 100644 --- a/pickle/pickle.py +++ b/pickle/pickle.py @@ -4,7 +4,7 @@ def dump(obj, f, proto=0): f.write(repr(obj)) def dumps(obj, proto=0): - return repr(obj) + return repr(obj).encode() def load(f): s = f.read() @@ -12,6 +12,7 @@ def load(f): def loads(s): d = {} + s = s.decode() if "(" in s: qualname = s.split("(", 1)[0] if "." in qualname: