[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset f35076a002b958f991d180d6f945344cc5ab3900 by Yury Selivanov (Miss Islington (bot)) in branch '3.6': bpo-32034: Make IncompleteReadError & LimitOverrunError pickleable GH-4409 (#4411)

[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread Yury Selivanov
Change by Yury Selivanov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4361 ___ Python tracker ___

[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 43605e6bfa8d49612df4a38460d063d6ba781906 by Yury Selivanov in branch 'master': bpo-32034: Make IncompleteReadError & LimitOverrunError pickleable #4409

[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is the same issue with LimitOverrunError. I'm not sure that we should keep args the same. It affects __str__ and __repr__. badouxn overrides __str__. And the result of __repr__ currently looks like the exception

[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread Yury Selivanov
Yury Selivanov added the comment: > Does such a fix looks correct to you ? No, this fix won't restore exception.args properly. I made a PR with a fix. -- ___ Python tracker

[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread Yury Selivanov
Change by Yury Selivanov : -- pull_requests: +4358 ___ Python tracker ___ ___

[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread badouxn
badouxn added the comment: Typo in the last comment. The code should be: ''' def __init__(self, partial, expected): super().__init__(partial, expected) self.partial = partial self.expected = expected def __str__(self): return ("%d

[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread badouxn
badouxn added the comment: My first fix was indeed wrong. Upon looking further into it, it seems to me that the problem come from the fact that the call to super is not done with the right argument. Upon unpickling, the argument that will be passed to the __init__ is the

[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This isn't so simple. >>> from asyncio.streams import IncompleteReadError >>> import pickle >>> e1 = IncompleteReadError(b'abc', 10) >>> e2 = pickle.loads(pickle.dumps(e1)) >>> print(e1) 3 bytes read on a total of 10 expected

[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread badouxn
Change by badouxn : -- keywords: +patch pull_requests: +4353 stage: -> patch review ___ Python tracker ___

[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread badouxn
Change by badouxn : -- versions: +Python 3.7 ___ Python tracker ___ ___ Python-bugs-list

[issue32034] Error when unpickling IncompleteReadError

2017-11-15 Thread badouxn
Change by badouxn : -- title: Impossible to unpickle IncompleteReadError -> Error when unpickling IncompleteReadError ___ Python tracker