Author badouxn
Recipients badouxn, serhiy.storchaka, yselivanov
Date 2017-11-15.17:32:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510767169.78.0.213398074469.issue32034@psf.upfronthosting.co.za>
In-reply-to
Content
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 string representation built on line 33-34.
That's why, when leaving expected as optional the number returned is 44, the length of the string. 

I went looking for similar Exception class in the code base and found the MaybeEncodingError in multiprocessing/pool.py 

By replacing the Error content with this one I don't have any error anymore. The message is kept identical. 
'''
     def __init__(self, partial, expected):
         super().__init__(partial, expected)
         self.partial = partial
         self.expected = expected
     def __str__(self):
         return ("%d bytes read on a total of %r expected bytes" % (len(partial), expected))
'''

Does such a fix looks correct to you ?
History
Date User Action Args
2017-11-15 17:32:49badouxnsetrecipients: + badouxn, serhiy.storchaka, yselivanov
2017-11-15 17:32:49badouxnsetmessageid: <1510767169.78.0.213398074469.issue32034@psf.upfronthosting.co.za>
2017-11-15 17:32:49badouxnlinkissue32034 messages
2017-11-15 17:32:49badouxncreate