From: Serhiy Storchaka Date: Fri, 7 Oct 2016 19:24:20 +0000 (+0300) Subject: Issue #26293: Fixed writing ZIP files that starts not from the start of the X-Git-Tag: v3.6.0b2~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=242c170f878cc38eb32b26b55f69a9d7cef947a7;p=thirdparty%2FPython%2Fcpython.git Issue #26293: Fixed writing ZIP files that starts not from the start of the file. Offsets in ZIP file now are relative to the start of the archive in conforming to the specification. --- 242c170f878cc38eb32b26b55f69a9d7cef947a7 diff --cc Lib/zipfile.py index 7ba4e5980b83,2476717c963a..e2ae042cfdb7 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@@ -1127,9 -1053,9 +1127,9 @@@ class ZipFile # set the modified flag so central directory gets written # even if no files are added to the archive self._didModify = True - self.start_dir = self.fp.tell() + self.start_dir = self._start_disk = self.fp.tell() else: - raise RuntimeError("Mode must be 'r', 'w', 'x', or 'a'") + raise ValueError("Mode must be 'r', 'w', 'x', or 'a'") except: fp = self.fp self.fp = None diff --cc Misc/NEWS index 2edec5ee5943,36a7f30a436c..051c5f65dd6e --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -25,72 -22,90 +25,76 @@@ Core and Builtin - Issue #21578: Fixed misleading error message when ImportError called with invalid keyword args. -- Issue #28203: Fix incorrect type in error message from - ``complex(1.0, {2:3})``. Patch by Soumya Sharma. - -- Issue #27955: Fallback on reading /dev/urandom device when the getrandom() - syscall fails with EPERM, for example when blocked by SECCOMP. +- Issue #28203: Fix incorrect type in complex(1.0, {2:3}) error message. + Patch by Soumya Sharma. -- Issue #28131: Fix a regression in zipimport's compile_source(). zipimport - should use the same optimization level as the interpreter. +- Issue #28086: Single var-positional argument of tuple subtype was passed + unscathed to the C-defined function. Now it is converted to exact tuple. -- Issue #25221: Fix corrupted result from PyLong_FromLong(0) when - Python is compiled with NSMALLPOSINTS = 0. +- Issue #28214: Now __set_name__ is looked up on the class instead of the + instance. -- Issue #25758: Prevents zipimport from unnecessarily encoding a filename - (patch by Eryk Sun) +- Issue #27955: Fallback on reading /dev/urandom device when the getrandom() + syscall fails with EPERM, for example when blocked by SECCOMP. -- Issue #28189: dictitems_contains no longer swallows compare errors. - (Patch by Xiang Zhang) +- Issue #28192: Don't import readline in isolated mode. -- Issue #27812: Properly clear out a generator's frame's backreference to the - generator to prevent crashes in frame.clear(). +- Upgrade internal unicode databases to Unicode version 9.0.0. -- Issue #27811: Fix a crash when a coroutine that has not been awaited is - finalized with warnings-as-errors enabled. +- Issue #28131: Fix a regression in zipimport's compile_source(). zipimport + should use the same optimization level as the interpreter. -- Issue #27587: Fix another issue found by PVS-Studio: Null pointer check - after use of 'def' in _PyState_AddModule(). - Initial patch by Christian Heimes. +- Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly + optimize memcpy(). -- Issue #26020: set literal evaluation order did not match documented behaviour. +- Issue #28120: Fix dict.pop() for splitted dictionary when trying to remove a + "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang. -- Issue #27782: Multi-phase extension module import now correctly allows the - ``m_methods`` field to be used to add module level functions to instances - of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang. +- Issue #26182: Raise DeprecationWarning when async and await keywords are + used as variable/attribute/class/function name. -- Issue #27936: The round() function accepted a second None argument - for some types but not for others. Fixed the inconsistency by - accepting None for all numeric types. +Library +------- -- Issue #27487: Warn if a submodule argument to "python -m" or - runpy.run_module() is found in sys.modules after parent packages are - imported, but before the submodule is executed. ++- Issue #26293: Fixed writing ZIP files that starts not from the start of the ++ file. Offsets in ZIP file now are relative to the start of the archive in ++ conforming to the specification. + -- Issue #27558: Fix a SystemError in the implementation of "raise" statement. - In a brand new thread, raise a RuntimeError since there is no active - exception to reraise. Patch written by Xiang Zhang. +- Issue #28380: unittest.mock Mock autospec functions now properly support + assert_called, assert_not_called, and assert_called_once. -- Issue #27419: Standard __import__() no longer look up "__import__" in globals - or builtins for importing submodules or "from import". Fixed handling an - error of non-string package name. +- Issue #27181 remove statistics.geometric_mean and defer until 3.7. -- Issue #27083: Respect the PYTHONCASEOK environment variable under Windows. +- Issue #28229: lzma module now supports pathlib. -- Issue #27514: Make having too many statically nested blocks a SyntaxError - instead of SystemError. +- Issue #28321: Fixed writing non-BMP characters with binary format in plistlib. -- Issue #27473: Fixed possible integer overflow in bytes and bytearray - concatenations. Patch by Xiang Zhang. +- Issue #28225: bz2 module now supports pathlib. Initial patch by Ethan Furman. -- Issue #27507: Add integer overflow check in bytearray.extend(). Patch by - Xiang Zhang. +- Issue #28227: gzip now supports pathlib. Patch by Ethan Furman. -- Issue #27581: Don't rely on wrapping for overflow check in - PySequence_Tuple(). Patch by Xiang Zhang. +- Issue #27358: Optimized merging var-keyword arguments and improved error + message when pass a non-mapping as a var-keyword argument. -- Issue #27443: __length_hint__() of bytearray iterators no longer return a - negative integer for a resized bytearray. +- Issue #28257: Improved error message when pass a non-iterable as + a var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL. -Library -------- +- Issue #28322: Fixed possible crashes when unpickle itertools objects from + incorrect pickle data. Based on patch by John Leitch. -- Issue #26293: Fixed writing ZIP files that starts not from the start of the - file. Offsets in ZIP file now are relative to the start of the archive in - conforming to the specification. +- Issue #28228: imghdr now supports pathlib. -- Issue #28321: Fixed writing non-BMP characters with binary format in plistlib. +- Issue #28226: compileall now supports pathlib. -- Issue #28322: Fixed possible crashes when unpickle itertools objects from - incorrect pickle data. Based on patch by John Leitch. +- Issue #28314: Fix function declaration (C flags) for the getiterator() method + of xml.etree.ElementTree.Element. -- Fix possible integer overflows and crashes in the mmap module with unusual - usage patterns. +- Issue #28148: Stop using localtime() and gmtime() in the time + module. -- Issue #1703178: Fix the ability to pass the --link-objects option to the - distutils build_ext command. + Introduced platform independent _PyTime_localtime API that is + similar to POSIX localtime_r, but available on all platforms. Patch + by Ed Schouten. - Issue #28253: Fixed calendar functions for extreme months: 0001-01 and 9999-12.