Commit Graph

18 Commits

Author SHA1 Message Date
Raymond Hettinger 2c45c9ae57 SF patch 1062495: Modules/zipimport.c does not compile on solaris
(Contributed by Niki W. Waibel.)

Simple renaming to avoid a conflict that prevented compilation on Solaris.
2004-11-10 13:08:35 +00:00
Just van Rossum ee8f10fa37 Patch #801349: 64-bit fix for AMD64 from Gwenole Beauchesne.
Classical problem with int vs. long mismatch in varargs.
2.3 backport candidate.
2003-09-07 13:36:48 +00:00
Thomas Heller 354e3d90d3 Change the zipimport implementation to accept files containing
arbitrary bytes before the actual zip compatible archive.  Zipfiles
containing comments at the end of the file are still not supported.

Add a testcase to test_zipimport, and update NEWS.

This closes sf #775637 and sf #669036.
2003-07-22 18:10:15 +00:00
Jeremy Hylton 032fffefe6 Remove unused variable. 2003-07-17 15:56:07 +00:00
Martin v. Löwis a94568a753 Patch #734231: Update RiscOS support. In particular, correct
riscospath.extsep, and use os.extsep throughout.
2003-05-10 07:36:56 +00:00
Just van Rossum 547eb42d75 tentative fix for #712322: modification time stamp checking failed
when DST began.
2003-04-08 20:07:15 +00:00
Neal Norwitz 29fd2baf82 Make private function and data static. 2003-03-23 13:21:03 +00:00
Just van Rossum f4ecc751b1 use proper constant instead of comment (noted by nnorwitz) 2003-02-28 08:54:01 +00:00
Neal Norwitz 0c0aad948a Fix 64-bit problem, ParseTuple("i") needs C ints; ("l") needs C longs.
Use "l" as that *probably* makes more sense (at least to me it does :-)
And the test passes on the alpha.
2003-02-18 03:37:49 +00:00
Neal Norwitz 5c1ba53f8c Use correct function name to PyArg_ParseTuple("is_package").
Fix off-by-1 error in normalize_line_endings():
  when *p == '\0' the NUL was copied into q and q was auto-incremented,
  the loop was broken out of,
  then a newline was appended followed by a NUL.
  So the function, in effect, was strcpy() but added two extra chars
  which was caught by obmalloc in debug mode, since there was only
  room for 1 additional newline.

Get test working under regrtest (added test_main).
2003-02-17 18:05:20 +00:00
Just van Rossum 9a3129c148 Fix for bug #661136
Lesson learned: kids should not be allowed to use API's starting
with an underscore :-/
zipimport in 2.3a1 is even more broken than I thought: I attemped
to _PyString_Resize a string created by PyString_FromStringAndSize,
which fails for strings with length 0 or 1 since the latter returns
an interned string in those cases. This would cause a SystemError
with empty source files (and no matching pyc) in the zip archive.
I rewrote the offending code to simply allocate a new buffer and
avoid _PyString_Resize altogether.
Added a test that would've caught the problem.
2003-01-03 11:18:56 +00:00
Just van Rossum d35c6db526 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.
2003-01-02 12:55:48 +00:00
Just van Rossum 3f0b542f25 removed unused get_short() function 2002-12-31 15:47:42 +00:00
Just van Rossum f8b6de168b - added missing decref
- whitespace normalization
2002-12-31 09:51:59 +00:00
Jack Jansen 5eaeaf9174 Added casts to forestall warnings with MetroWerks. 2002-12-30 23:06:14 +00:00
Tim Peters f271c272a2 Squashed compiler wng from MSVC6. 2002-12-30 22:44:03 +00:00
Tim Peters 1ea93f2b1d Wouldn't compile on Windows; fixed. 2002-12-30 22:42:57 +00:00
Just van Rossum 52e14d640b PEP 302 + zipimport:
- new import hooks in import.c, exposed in the sys module
- new module called 'zipimport'
- various changes to allow bootstrapping from zip files

I hope I didn't break the Windows build (or anything else for that
matter), but then again, it's been sitting on sf long enough...

Regarding the latest discussions on python-dev: zipimport sets
pkg.__path__ as specified in PEP 273, and likewise, sys.path item such as
/path/to/Archive.zip/subdir/ are supported again.
2002-12-30 22:08:05 +00:00