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 ggenellina
Recipients ggenellina, mwm
Date 2009-02-28.05:55:26
SpamBayes Score 3.7979087e-06
Marked as misclassified No
Message-id <1235800528.86.0.40535520318.issue5370@psf.upfronthosting.co.za>
In-reply-to
Content
The __getattr__ method, as written, assumes that an attribute 'args' 
already exists. That's unsafe - a more robust approach would be:

    def __getattr__(self, name):
        if 'attrs' in self.__dict__ and name in self.attrs:
            return self.attrs[name]
        raise AttributeError(name)

The suggestion of using hasattr in pickle code doesn't work, because 
hasattr is implemented using getattr.

I could not reproduce it with 2.6, nor the trunk -- there is another 
recursion problem involving __subclasscheck__ but unpickling is 
unaffected. 3.0 does show this problem. FWIW, 2.2 did not.
History
Date User Action Args
2009-02-28 05:55:29ggenellinasetrecipients: + ggenellina, mwm
2009-02-28 05:55:28ggenellinasetmessageid: <1235800528.86.0.40535520318.issue5370@psf.upfronthosting.co.za>
2009-02-28 05:55:27ggenellinalinkissue5370 messages
2009-02-28 05:55:26ggenellinacreate