diff -r 3b1dbe7a2aa0 Modules/zipimport.c --- a/Modules/zipimport.c Wed Apr 03 07:01:07 2013 -0400 +++ b/Modules/zipimport.c Thu Apr 04 11:00:56 2013 +0100 @@ -349,7 +349,8 @@ if (mi == MI_NOT_FOUND) { /* Not a module or regular package. See if this is a directory, and therefore possibly a portion of a namespace package. */ - int is_dir = check_is_directory(self, self->prefix, fullname); + PyObject *subname = get_subname(fullname); + int is_dir = check_is_directory(self, self->prefix, subname); if (is_dir < 0) return -1; if (is_dir) { @@ -358,7 +359,7 @@ without a trailing separator. */ *namespace_portion = PyUnicode_FromFormat("%U%c%U%U", self->archive, SEP, - self->prefix, fullname); + self->prefix, subname); if (*namespace_portion == NULL) return FL_ERROR; return FL_NS_FOUND;