[issue19209] Remove import copyreg from os module

2013-10-11 Thread Christian Heimes
Christian Heimes added the comment: os_stat_statvfs_pickle.patch with comments and tests. -- Added file: http://bugs.python.org/file32051/os_stat_statvfs_pickle2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19209

[issue19209] Remove import copyreg from os module

2013-10-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 29c4a6a11e76 by Christian Heimes in branch 'default': Issue #19209: Remove import of copyreg from the os module to speed up http://hg.python.org/cpython/rev/29c4a6a11e76 -- nosy: +python-dev ___ Python

[issue19209] Remove import copyreg from os module

2013-10-11 Thread Christian Heimes
Christian Heimes added the comment: Thanks for your help! Python is down to 43 modules on Linux. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue19209] Remove import copyreg from os module

2013-10-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 89e405e6a7a9 by Christian Heimes in branch 'default': Issue #19209: fix structseq test http://hg.python.org/cpython/rev/89e405e6a7a9 -- ___ Python tracker rep...@bugs.python.org

[issue19209] Remove import copyreg from os module

2013-10-10 Thread STINNER Victor
STINNER Victor added the comment: Can't we modify the qualified name instead? Attached os_stat_statvfs_pickle.patch implements this idea. IMO it's much simpler because it removes completly the need of the copyreg module. Example with the patch on Linux: $ ./python Python 3.4.0a3+

[issue19209] Remove import copyreg from os module

2013-10-09 Thread Christian Heimes
New submission from Christian Heimes: The patch removes import copyreg from the os module and moves the registration of the hooks to copyreg. This speeds up the startup of the interpreter a tiny bit. -- files: os_no_copyreg.patch keywords: patch messages: 199303 nosy: christian.heimes

[issue19209] Remove import copyreg from os module

2013-10-09 Thread Georg Brandl
Georg Brandl added the comment: +1 -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19209 ___ ___ Python-bugs-list mailing

[issue19209] Remove import copyreg from os module

2013-10-09 Thread STINNER Victor
STINNER Victor added the comment: I don't know the copyreg module! Does it have a unit test for the registered os objects? If not, how can it be tested manually? -- nosy: +haypo ___ Python tracker rep...@bugs.python.org

[issue19209] Remove import copyreg from os module

2013-10-09 Thread Christian Heimes
Christian Heimes added the comment: import os import pickle pickle.dumps(os.stat(.))

[issue19209] Remove import copyreg from os module

2013-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What will happen when do not register stat_result and statvfs_result at all? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19209

[issue19209] Remove import copyreg from os module

2013-10-09 Thread Christian Heimes
Christian Heimes added the comment: You can still pickle and unpickle the objects but the result is no longer platform-independent as it refers to posix or nt instead of os. import os, pickle, pickletools pickletools.dis(pickle.dumps(os.stat(.))) 0: \x80 PROTO 3 2: cGLOBAL

[issue19209] Remove import copyreg from os module

2013-10-09 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19209 ___ ___ Python-bugs-list mailing

[issue19209] Remove import copyreg from os module

2013-10-09 Thread STINNER Victor
STINNER Victor added the comment: Can't we modify the qualified name instead? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19209 ___ ___

[issue19209] Remove import copyreg from os module

2013-10-09 Thread Georg Brandl
Georg Brandl added the comment: But for pickling something, you have to import pickle, which always imports copyreg anyway, doesn't it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19209

[issue19209] Remove import copyreg from os module

2013-10-09 Thread Christian Heimes
Christian Heimes added the comment: Exactly, the pickle module depends on the copyreg module. It's a submodule that acts as a registry for pickle-related lookups and hooks. My patch just moves the registration of these hooks out of the os module into the copyreg module. --

[issue19209] Remove import copyreg from os module

2013-10-09 Thread Georg Brandl
Georg Brandl added the comment: I don't see a problem with that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19209 ___ ___ Python-bugs-list

[issue19209] Remove import copyreg from os module

2013-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How much this speed up the startup of the interpreter? Proposed patch looks contrary to purpose of the copyreg module. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19209

[issue19209] Remove import copyreg from os module

2013-10-09 Thread Christian Heimes
Christian Heimes added the comment: The speedup is minimal but it's a start. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19209 ___ ___

[issue19209] Remove import copyreg from os module

2013-10-09 Thread STINNER Victor
STINNER Victor added the comment: os_no_copyreg.patch looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19209 ___ ___

[issue19209] Remove import copyreg from os module

2013-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't think we should tangent code for such tiny benefit. copyreg is lightweight module specially designed to break coupling of the code. -- ___ Python tracker rep...@bugs.python.org