summaryrefslogtreecommitdiffstats
path: root/Modules/zipimport.c
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2003-01-02 12:55:48 (GMT)
committerJust van Rossum <just@letterror.com>2003-01-02 12:55:48 (GMT)
commitd35c6db526a6ce1656de2c9998a866445fdf5fe4 (patch)
treec1c50bb7dd80c1e01380260a5aef9ae9a2ece30f /Modules/zipimport.c
parentc6fff897d7464a15cdcbab723b170d223b906004 (diff)
downloadcpython-d35c6db526a6ce1656de2c9998a866445fdf5fe4.zip
cpython-d35c6db526a6ce1656de2c9998a866445fdf5fe4.tar.gz
cpython-d35c6db526a6ce1656de2c9998a866445fdf5fe4.tar.bz2
Ugh, zipimport is virtually broken in 2.3a1 :-( It worked by accident in
the test set as it only tested with a zip archive in the current directory, but it doesn't work at all for packages when the zip archive was specified as an absolute path. It's a real embarrassing bug: a strchr call should have been strrchr; fever apparently implies dyslexia. Second stupid bug: the zipimport test failed with a name error __importer__ (which I had renamed to __loader__ everywhere but here). I would've sworn I ran the test after that change but that can't be true. What I don't understand that noone reported a failing test_zipimport.py before the release of 2.3a1.
Diffstat (limited to 'Modules/zipimport.c')
-rw-r--r--Modules/zipimport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index f3f5245..b12f1ab 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -103,7 +103,7 @@ zipimporter_init(ZipImporter *self, PyObject *args, PyObject *kwds)
break;
}
/* back up one path element */
- p = strchr(buf, SEP);
+ p = strrchr(buf, SEP);
if (prefix != NULL)
*prefix = SEP;
if (p == NULL)