Message180669
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. |
|
Date |
User |
Action |
Args |
2013-01-26 13:46:48 | eli.bendersky | set | recipients:
+ eli.bendersky, Arfrever, r.david.murray, asvetlov, eric.snow, danielsh |
2013-01-26 13:46:48 | eli.bendersky | set | messageid: <1359208008.52.0.922836453849.issue16817@psf.upfronthosting.co.za> |
2013-01-26 13:46:48 | eli.bendersky | link | issue16817 messages |
2013-01-26 13:46:48 | eli.bendersky | create | |
|