This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients davidparks21, serhiy.storchaka, xtreak
Date 2019-09-24.17:04:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1569344699.23.0.597520688684.issue38254@roundup.psfhosted.org>
In-reply-to
Content
Thanks for the clarification and the answer link. I was also just debugging along the similar lines around how OSError.__reduce__ treats the arguments something like. Custom __reduce__ for aiohttp works as explained in the SO answer.


class SubOSError(OSError):

    def __init__(self, foo, os_error, /):
        self.foo = foo
        self.os_error = os_error
        super().__init__(os_error.errno, os_error.strerror)

    def __reduce__(self): # Custom __reduce__
        return (self.__class__, (self.foo, self.os_error ))

    def __reduce__(self): # OSError __reduce__
        return (self.__class__, (self.os_error.errno, self.os_error.strerror ))
History
Date User Action Args
2019-09-24 17:04:59xtreaksetrecipients: + xtreak, serhiy.storchaka, davidparks21
2019-09-24 17:04:59xtreaksetmessageid: <1569344699.23.0.597520688684.issue38254@roundup.psfhosted.org>
2019-09-24 17:04:59xtreaklinkissue38254 messages
2019-09-24 17:04:59xtreakcreate