Commit Graph

35 Commits

Author SHA1 Message Date
Benjamin Peterson
f387e96768 remove tests for #19081 2014-02-16 14:48:26 -05:00
Benjamin Peterson
e9aab0fb98 backout #19081 to fix #20621 2014-02-16 14:20:14 -05:00
Gregory P. Smith
9ca520a09c Remove unneeded use of globals() and locals() in test on imports
introduced with the issue19081 tests.
2014-01-28 00:29:46 -08:00
Gregory P. Smith
1a47955255 Refactor the new test for issue19081 to exec import statements into a
test_ns dict instead of the actual globals() and locals().  Suggested
after review by Thomas Wouters.
2014-01-27 22:06:51 -08:00
Gregory P. Smith
027ab39014 Issue #19081: Remove the zipimporter.files reference as the zip TOC
caches are module global in the zip_directory_cache. When it is
updated due to a changed zip file, all zipimporter instances need to
see the same updates TOC cache.  This fixes the bug for the overlooked
submodule import case from the earlier round of changes.  Includes
tests that would fail otherwise.

It also refactors zipimporter_init in the process to make it a bit
easier to read and understand.  Less reuse of the same variable for
multiple purposes and the local path buffer is malloc'ed instead
of consuming a large MAXPATHLEN+2 chunk stack space.
2014-01-27 00:15:10 -08:00
Gregory P. Smith
f5dee4ddbd normalize whitespace from prior issue19081 fix commit. 2014-01-06 09:51:32 -08:00
Gregory P. Smith
b48c5d5107 Fixes issue19081: When a zipimport .zip file in sys.path being imported
from is modified during the lifetime of the Python process after
zipimport has already opened and cached the zip's table of contents
it now fstat's the file after opening it upon every attempt to access
anything within and will re-read the table of contents if the .zip file
inode, size or mtime have changed.

It would've been nicer to hold any .zip file used by zipimport open for the
duration of the process but that would be more invasive and add an additional
open file descriptor to all zipimport using processes.  It also would likely
not fix the problem on Windows due to different filesystem semantics.
2014-01-06 09:46:46 -08:00
Zachary Ware
1f70221b86 Issue #19572: More silently skipped tests explicitly skipped. 2013-12-10 14:09:20 -06:00
Victor Stinner
f58f1c33c1 Issue #12124: zipimport doesn't keep a reference to zlib.decompress() anymore
to be able to unload the module.
2011-05-21 02:13:22 +02:00
Ezio Melotti
2623a37852 Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line

  #9424: Replace deprecated assert* methods in the Python test suite.
........
2010-11-21 13:34:58 +00:00
Georg Brandl
d10d8ee2a1 Fix various missing import/unbound name errors. 2010-02-06 23:18:00 +00:00
Ezio Melotti
aa98058cc4 use assert[Not]In where appropriate 2010-01-23 23:04:36 +00:00
Ezio Melotti
1036a7f7e1 #6026 - fix tests that failed without zlib 2009-09-12 14:43:43 +00:00
Benjamin Peterson
5c8da86f3a convert usage of fail* to assert* 2009-06-30 22:57:08 +00:00
Nick Coghlan
0194f5bc98 Issue #4512 closeout: Make ZipImport.get_filename() a public method 2009-02-08 03:17:00 +00:00
Nick Coghlan
a2053475bb Fix several issues relating to access to source code inside zipfiles. Initial work by Alexander Belopolsky. See Misc/NEWS in this checkin for details. 2008-12-14 10:54:50 +00:00
Georg Brandl
6a57c08dc8 #1326: document and test zipimporter.archive and zipimporter.prefix. 2008-05-11 15:05:13 +00:00
Georg Brandl
e260ba2d33 #1325: Add docs and tests for zipimporter.archive and zipimporter.prefix. 2008-01-06 16:49:50 +00:00
Tim Peters
413c9226d2 Whitespace normalization. 2006-04-11 01:44:26 +00:00
Phillip J. Eby
4703211080 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
to work correctly with modules imported from zipfiles or via other PEP 302
__loader__ objects.  Tests and doc updates are included.
2006-04-11 01:07:43 +00:00
Tim Peters
68f2d000e9 Repaired new test failures on Windows:
- The path separator isn't "/" on Windows.

- Leaving behind a read-only file causes cascades
  of bogus failures on Windows.
2006-01-23 22:19:24 +00:00
Tim Peters
bc29c1a4cc Whitespace normalization. 2006-01-23 21:28:42 +00:00
Neal Norwitz
dbc95f4222 Disable this test until I can test on big-endian machines and get passing 2006-01-23 08:48:03 +00:00
Neal Norwitz
b155b62f54 Test zipimporter a bit more. Also get working with -R :: option for finding ref leaks 2006-01-23 07:52:13 +00:00
Just van Rossum
5949854200 Fix for [ 765456 ]: testAFakeZlib failed on platforms that use a
statically linked zlib module, but since the problem it tests can't
exist on these systems, simply skip it then. Will backport.
2003-11-18 23:00:55 +00:00