[issue22676] _pickle's whichmodule() is slow

Zachary Ware report at bugs.python.org
Tue Nov 25 05:35:15 CET 2014


Zachary Ware added the comment:

This is still causing a somewhat serious warning on Windows, see [1] for example.  The condition warned about affects every platform.

It took me some time to make sense of that function, but I think I finally understand what's going on.  I think Steve's suggestion of initializing module to Py_None would be fine, or just pass in a known good object like global instead since the 'obj' parameter is only used for error message formatting.  Either way, I think the error check at Modules/_pickle.c:1657 [2] should either use reformat_attribute_error() or do the reformatting itself (to provide a different message) because I don't think the AttributeError message from get_dotted_path would be anywhere close to correct (especially if 'obj' is given as Py_None).

[1] http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/8969/steps/compile/logs/stdio
[2] Steve: the 'Comment:' label in the form is a handy link to the devguide section about how magic links work.  In this case, it's filepath.ext:number

----------
nosy: +zach.ware
resolution: fixed -> 
stage: resolved -> commit review
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22676>
_______________________________________


More information about the Python-bugs-list mailing list