core: wrapper functions provide no protection in this case
This commit is contained in:
parent
49eae23f92
commit
a37ccabd91
|
@ -118,7 +118,7 @@ class Blob(BytesType):
|
||||||
return '[blob: %d bytes]' % len(self)
|
return '[blob: %d bytes]' % len(self)
|
||||||
|
|
||||||
def __reduce__(self):
|
def __reduce__(self):
|
||||||
return (_unpickle_blob, (BytesType(self),))
|
return (Blob, (BytesType(self),))
|
||||||
|
|
||||||
|
|
||||||
class Secret(UnicodeType):
|
class Secret(UnicodeType):
|
||||||
|
@ -129,7 +129,7 @@ class Secret(UnicodeType):
|
||||||
return UnicodeType(self)
|
return UnicodeType(self)
|
||||||
|
|
||||||
def __reduce__(self):
|
def __reduce__(self):
|
||||||
return (_unpickle_secret, (UnicodeType(self),))
|
return (Secret, (UnicodeType(self),))
|
||||||
|
|
||||||
|
|
||||||
class CallError(Error):
|
class CallError(Error):
|
||||||
|
@ -150,14 +150,6 @@ class CallError(Error):
|
||||||
return (_unpickle_call_error, (self[0],))
|
return (_unpickle_call_error, (self[0],))
|
||||||
|
|
||||||
|
|
||||||
def _unpickle_blob(s):
|
|
||||||
return Blob(s)
|
|
||||||
|
|
||||||
|
|
||||||
def _unpickle_secret(s):
|
|
||||||
return Secret(s)
|
|
||||||
|
|
||||||
|
|
||||||
def _unpickle_call_error(s):
|
def _unpickle_call_error(s):
|
||||||
if not (type(s) is str and len(s) < 10000):
|
if not (type(s) is str and len(s) < 10000):
|
||||||
raise TypeError('cannot unpickle CallError: bad input')
|
raise TypeError('cannot unpickle CallError: bad input')
|
||||||
|
@ -341,10 +333,10 @@ class Message(object):
|
||||||
return self._unpickle_sender
|
return self._unpickle_sender
|
||||||
elif func == '_unpickle_context':
|
elif func == '_unpickle_context':
|
||||||
return self._unpickle_context
|
return self._unpickle_context
|
||||||
elif func == '_unpickle_blob':
|
elif func == 'Blob':
|
||||||
return _unpickle_blob
|
return Blob
|
||||||
elif func == '_unpickle_secret':
|
elif func == 'Secret':
|
||||||
return _unpickle_secret
|
return Secret
|
||||||
raise StreamError('cannot unpickle %r/%r', module, func)
|
raise StreamError('cannot unpickle %r/%r', module, func)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in New Issue