I've responded to the review points. Am uploading a new patch now. http://bugs.python.org/review/14905/diff/5345/Modules/zipimport.c File Modules/zipimport.c ...
http://bugs.python.org/review/14905/diff/5772/Modules/zipimport.c File Modules/zipimport.c (right): http://bugs.python.org/review/14905/diff/5772/Modules/zipimport.c#newcode484 Modules/zipimport.c:484: if (err == -1) This is an unrelated change. ...
http://bugs.python.org/review/14905/diff/5772/Modules/zipimport.c File Modules/zipimport.c (right): http://bugs.python.org/review/14905/diff/5772/Modules/zipimport.c#newcode973 Modules/zipimport.c:973: Some comments here about why this loop exists would ...
http://bugs.python.org/review/14905/diff/5772/Modules/zipimport.c
File Modules/zipimport.c (right):
http://bugs.python.org/review/14905/diff/5772/Modules/zipimport.c#newcode973
Modules/zipimport.c:973:
Some comments here about why this loop exists would be helpful. If I stumbled
across this code, it would take me a while to figure out what it's doing.
In fact, maybe moving this entire inner loop out into a function
add_missing_dirs(files, nameobj) (or whatever params are needed) might be a good
idea.
http://bugs.python.org/review/14905/diff/5772/Modules/zipimport.c#newcode979
Modules/zipimport.c:979: Py_UCS4 c = PyUnicode_READ_CHAR(nameobj, i);
I think using PyUnicode_FindChar would be better than looping over every
individual character. Speed probably won't make a difference (and might be
worse), but it would improve readability.
http://bugs.python.org/review/14905/diff/5772/Modules/zipimport.c#newcode998
Modules/zipimport.c:998: toc_entry = Py_BuildValue("Ohllnhhl", path, 0, 0, 0, 0,
0, 0, 0);
On 2013/02/16 23:36:26, storchaka wrote:
> Use "N" format for path and don't decref path.
I think creating a function new_toc_entry(path, ...) would be a good idea.
Having 2 calls to Py_BuildValue that must be in sync is a maintenance problem
waiting to happen.
Issue 14905: zipimport.c needs to support namespace packages when no 'directory' entry exists
Created 10 months, 2 weeks ago by eric.smith
Modified 3 months ago
Reviewers: berkerpeksag, eric.snow, jerub, storchaka
Base URL: None
Comments: 31