[Python-checkins] python/dist/src/Modules zipimport.c,1.6,1.7

jvr@users.sourceforge.net jvr@users.sourceforge.net
Thu, 02 Jan 2003 04:55:50 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv1959/Modules

Modified Files:
	zipimport.c 
Log Message:
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.


Index: zipimport.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/zipimport.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** zipimport.c	31 Dec 2002 15:47:42 -0000	1.6
--- zipimport.c	2 Jan 2003 12:55:48 -0000	1.7
***************
*** 104,108 ****
  		}
  		/* back up one path element */
! 		p = strchr(buf, SEP);
  		if (prefix != NULL)
  			*prefix = SEP;
--- 104,108 ----
  		}
  		/* back up one path element */
! 		p = strrchr(buf, SEP);
  		if (prefix != NULL)
  			*prefix = SEP;