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 eli.bendersky
Recipients Arfrever, asvetlov, danielsh, eli.bendersky, eric.snow, r.david.murray
Date 2013-01-26.13:46:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1359208008.52.0.922836453849.issue16817@psf.upfronthosting.co.za>
In-reply-to
Content
Eric, yes the key code in test_xml_etree that handles this is:

    def pickleRoundTrip(self, obj, name, dumper, loader):
        save_m = sys.modules[name]
        try:
            sys.modules[name] = dumper
            temp = pickle.dumps(obj)
            sys.modules[name] = loader
            result = pickle.loads(temp)
        except pickle.PicklingError as pe:
            # pyET must be second, because pyET may be (equal to) ET.
            human = dict([(ET, "cET"), (pyET, "pyET")])
            raise support.TestFailed("Failed to round-trip %r from %r to %r"
                                     % (obj,
                                        human.get(dumper, dumper),
                                        human.get(loader, loader))) from pe
        finally:
            sys.modules[name] = save_m
        return result

Because pickle does its own import of ElementTree.

The test___all__ problem should be solved by a patch to issue #1674555, but having a separate mechanism in test.support was discussed. I'll take a look at your decorator.
History
Date User Action Args
2013-01-26 13:46:48eli.benderskysetrecipients: + eli.bendersky, Arfrever, r.david.murray, asvetlov, eric.snow, danielsh
2013-01-26 13:46:48eli.benderskysetmessageid: <1359208008.52.0.922836453849.issue16817@psf.upfronthosting.co.za>
2013-01-26 13:46:48eli.benderskylinkissue16817 messages
2013-01-26 13:46:48eli.benderskycreate