summaryrefslogtreecommitdiffstats
path: root/Modules/zlibmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Close #18294: Fix the zlib module to make it 64-bit safeVictor Stinner2013-11-211-55/+125
|
* Argument Clinic: rename "self" to "module" for module-level functions.Larry Hastings2013-11-181-19/+21
|
* Issue #16612: Add "Argument Clinic", a compile-time preprocessorLarry Hastings2013-10-191-61/+122
| | | | for C files to generate argument parsing code. (See PEP 436.)
* Issue #18408: Fix usage of _PyBytes_Resize()Victor Stinner2013-07-081-16/+8
| | | | | _PyBytes_Resize(&v, new_size) sets v to NULL on error, so v cannot be used anymore. Replace "Py_DECREF(v); v = NULL;" with "Py_CLEAR(v);".
* Issue #18408: Fix zlib.compressobj() to handle PyThread_allocate_lock() failureVictor Stinner2013-07-081-0/+4
| | | | (MemoryError).
* Issue #18227: "Free" function of bz2, lzma and zlib modules has no return ↵Victor Stinner2013-07-071-1/+1
| | | | value (void)
* Issue #18227: Use PyMem_RawAlloc() in bz2, lzma and zlib modulesVictor Stinner2013-07-071-8/+28
|
* Issue #18203: Replace malloc() with PyMem_Malloc() in Python modulesVictor Stinner2013-07-071-2/+2
| | | | | Replace malloc() with PyMem_Malloc() when the GIL is held, or with PyMem_RawMalloc() otherwise.
* Issue #9566: zlib: Explicit cast to unsigned int to fix a compiler warning ↵Victor Stinner2013-06-241-4/+4
| | | | on Windows x64
* Issue #17917: Use PyModule_AddIntMacro() instead of PyModule_AddIntConstant()Charles-Francois Natali2013-05-201-14/+14
| | | | when applicable.
* zlib: Explicit cast to fix a compiler warningVictor Stinner2013-05-071-1/+1
|
* Issue #15677: Document that zlib and gzip accept a compression level of 0 to ↵Nadeem Vawda2012-11-111-2/+2
|\ | | | | | | | | | | mean 'no compression'. Patch by Brian Brazil.
| * Issue #15677: Document that zlib and gzip accept a compression level of 0 to ↵Nadeem Vawda2012-11-111-2/+2
| |\ | | | | | | | | | | | | | | | mean 'no compression'. Patch by Brian Brazil.
| | * Issue #15677: Document that zlib and gzip accept a compression level of 0 to ↵Nadeem Vawda2012-11-111-3/+3
| | | | | | | | | | | | | | | | | | mean 'no compression'. Patch by Brian Brazil.
* | | Issue #16411: Fix a bug where zlib.decompressobj().flush() might try to ↵Nadeem Vawda2012-11-111-0/+2
|\ \ \ | |/ / | | | | | | | | | | | | access previously-freed memory. Patch by Serhiy Storchaka.
| * | Issue #16411: Fix a bug where zlib.decompressobj().flush() might try to ↵Nadeem Vawda2012-11-111-0/+2
| |\ \ | | |/ | | | | | | | | | | | | access previously-freed memory. Patch by Serhiy Storchaka.
| | * Issue #16411: Fix a bug where zlib.decompressobj().flush() might try to ↵Nadeem Vawda2012-11-111-0/+2
| | | | | | | | | | | | | | | | | | access previously-freed memory. Patch by Serhiy Storchaka.
* | | Issue #16350, part 2: Set unused_data (and unconsumed_tail) correctly in ↵Nadeem Vawda2012-11-111-44/+54
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | decompressobj().flush(). Additionally, fix a bug where a MemoryError in allocating a bytes object could leave the decompressor object in an invalid state (with its unconsumed_tail member being NULL). Patch by Serhiy Storchaka.
| * | Issue #16350, part 2: Set unused_data (and unconsumed_tail) correctly in ↵Nadeem Vawda2012-11-111-44/+54
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | decompressobj().flush(). Additionally, fix a bug where a MemoryError in allocating a bytes object could leave the decompressor object in an invalid state (with its unconsumed_tail member being NULL). Patch by Serhiy Storchaka.
| | * Issue #16350, part 2: Set unused_data (and unconsumed_tail) correctly in ↵Nadeem Vawda2012-11-111-45/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | decompressobj().flush(). Additionally, fix a bug where a MemoryError in allocating a bytes object could leave the decompressor object in an invalid state (with its unconsumed_tail member being NULL). Patch by Serhiy Storchaka.
* | | Issue #16350: Fix zlib decompressor handling of unused_data with multiple ↵Nadeem Vawda2012-11-041-6/+23
|\ \ \ | |/ / | | | | | | | | | | | | calls to decompress() after EOF. Patch by Serhiy Storchaka.
| * | Issue #16350: Fix zlib decompressor handling of unused_data with multiple ↵Nadeem Vawda2012-11-041-6/+23
| |\ \ | | |/ | | | | | | | | | | | | calls to decompress() after EOF. Patch by Serhiy Storchaka.
| | * Issue #16350: Fix zlib decompressor handling of unused_data with multiple ↵Nadeem Vawda2012-11-041-6/+23
| | | | | | | | | | | | | | | | | | calls to decompress() after EOF. Patch by Serhiy Storchaka.
* | | Issue #9566: Explicit downcast to fix compiler warnings on Win64Victor Stinner2012-10-301-2/+2
|/ /
* | Document the rest of zlib.compressobj()'s arguments.Nadeem Vawda2012-06-211-4/+17
| | | | | | | | Original patch by Jim Jewett; see issue 14684.
* | Tidy up comments from dd4f7d5c51c7 (zlib compression dictionary support).Nadeem Vawda2012-06-211-1/+1
| |
* | Issue #14684: Add support for predefined compression dictionaries to the ↵Nadeem Vawda2012-06-211-22/+96
| | | | | | | | | | | | zlib module. Original patch by Sam Rushing.
* | Issue #12306: Add ZLIB_RUNTIME_VERSION to the zlib module.Nadeem Vawda2011-09-111-0/+4
| | | | | | | | | | | | While we're at it, also document ZLIB_VERSION. Patch by Torsten Landschoff.
* | Merge: #12839: Fix crash in zlib module due to version mismatch.Nadeem Vawda2011-08-281-1/+7
|\ \ | |/ | | | | | | | | | | | | | | If the version of zlib used to compile the zlib module is incompatible with the one that is actually linked in, then calls into zlib will fail. This can leave attributes of the z_stream uninitialized, so we must take care to avoid segfaulting by trying to use an invalid pointer. Fix by Richard M. Tew.
| * Issue #12839: Fix crash in zlib module due to version mismatch.Nadeem Vawda2011-08-281-1/+7
| | | | | | | | | | | | | | | | | | If the version of zlib used to compile the zlib module is incompatible with the one that is actually linked in, then calls into zlib will fail. This can leave attributes of the z_stream uninitialized, so we must take care to avoid segfaulting by trying to use an invalid pointer. Fix by Richard M. Tew.
* | Fix incorrect comment in zlib.Decompress.flush().Nadeem Vawda2011-08-131-3/+1
| | | | | | | | Reported by Oleg Oshmyan in issue #12646.
* | Issue #12646: Add an 'eof' attribute to zlib.Decompress.Nadeem Vawda2011-08-131-6/+13
|/ | | | | | This will make it easier to detect truncated input streams. Also, make zlib's error messages more consistent.
* Issue #8650: Make zlib.[de]compressobj().[de]compress() 64-bit clean.Nadeem Vawda2011-05-141-14/+23
| | | | | Raise an OverflowError if the input data is too large, instead of silently truncating the input and returning an incorrect result.
* Issue #8650: Backport 64-bit safety fixes for compress() and decompress().Nadeem Vawda2011-05-141-10/+21
|
* Issue #12050: zlib.decompressobj().decompress() now clears the unconsumed_tailNadeem Vawda2011-05-141-7/+12
| | | | attribute when called without a max_length argument.
* Merged revisions 88460,88464,88466,88486,88511,88652 via svnmerge fromAntoine Pitrou2011-02-281-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88460 | antoine.pitrou | 2011-02-21 19:03:13 +0100 (lun., 21 févr. 2011) | 4 lines Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers larger than 4GB. Patch by Nadeem Vawda. ........ r88464 | antoine.pitrou | 2011-02-21 20:05:08 +0100 (lun., 21 févr. 2011) | 3 lines Fix issues on 32-bit systems introduced by r88460 ........ r88466 | antoine.pitrou | 2011-02-21 20:28:40 +0100 (lun., 21 févr. 2011) | 3 lines Fix compile error under MSVC introduced by r88460. ........ r88486 | antoine.pitrou | 2011-02-22 00:41:12 +0100 (mar., 22 févr. 2011) | 5 lines Issue #4681: Allow mmap() to work on file sizes and offsets larger than 4GB, even on 32-bit builds. Initial patch by Ross Lagerwall, adapted for 32-bit Windows. ........ r88511 | antoine.pitrou | 2011-02-22 22:42:56 +0100 (mar., 22 févr. 2011) | 4 lines Issue #11277: finally fix Snow Leopard crash following r88460. (probably an OS-related issue with mmap) ........ r88652 | antoine.pitrou | 2011-02-26 16:58:05 +0100 (sam., 26 févr. 2011) | 4 lines Issue #9931: Fix hangs in GUI tests under Windows in certain conditions. Patch by Hirokazu Yamamoto. ........
* Merged revisions 81100 via svnmerge fromAntoine Pitrou2010-05-111-4/+17
| | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81100 | antoine.pitrou | 2010-05-12 01:46:02 +0200 (mer., 12 mai 2010) | 10 lines Merged revisions 81098 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81098 | antoine.pitrou | 2010-05-12 01:42:28 +0200 (mer., 12 mai 2010) | 5 lines Issue #8681: Make the zlib module's error messages more informative when the zlib itself doesn't give any detailed explanation. ........ ................
* Recorded merge of revisions 81032 via svnmerge fromAntoine Pitrou2010-05-091-231/+231
| | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines Recorded merge of revisions 81029 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........ ................
* Merged revisions 80928 via svnmerge fromAntoine Pitrou2010-05-071-3/+4
| | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80928 | antoine.pitrou | 2010-05-07 19:04:02 +0200 (ven., 07 mai 2010) | 11 lines Merged revisions 80926 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80926 | antoine.pitrou | 2010-05-07 18:50:34 +0200 (ven., 07 mai 2010) | 5 lines Issue #8571: Fix an internal error when compressing or decompressing a chunk larger than 1GB with the zlib module's compressor and decompressor objects. ........ ................
* Merged revisions 76836 via svnmerge fromAntoine Pitrou2009-12-141-8/+8
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r76836 | antoine.pitrou | 2009-12-14 19:00:06 +0100 (lun., 14 déc. 2009) | 5 lines Issue #4757: `zlib.compress` and other methods in the zlib module now raise a TypeError when given an `str` object (rather than a `bytes`-like object). Patch by Victor Stinner and Florent Xicluna. ........
* Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson2009-02-021-2/+2
| | | | | type of tp_compare in a separate commit, for ease of reversion should things go wrong.
* Issue #4738: finer-grained locking in the zlib module.Antoine Pitrou2009-01-021-61/+63
|
* Fixes release blocker issue #3492 and #3790.Gregory P. Smith2008-09-061-31/+31
| | | | | Make zlib and zipimport to return bytes instead of bytearray and use bytes rather than bytearray for their internal leftover data storages.
* Merged revisions 65654 via svnmerge fromMartin v. Löwis2008-08-131-14/+39
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r65654 | martin.v.loewis | 2008-08-12 16:49:50 +0200 (Tue, 12 Aug 2008) | 6 lines Issue #3139: Make buffer-interface thread-safe wrt. PyArg_ParseTuple, by denying s# to parse objects that have a releasebuffer procedure, and introducing s*. More module might need to get converted to use s*. ........
* #3247 Get rid of Py_FindMethod; use tp_members instead.Amaury Forgeot d'Arc2008-07-021-33/+44
| | | | | | | Otherwise dir(_sre.SRE_Match) returns an empty list. First step: handle most occurrences, remove tp_getattr and fill the tp_methods and tp_members slots. Add some test about attribute access.
* Implement PEP 3121: new module initialization and finalization API.Martin v. Löwis2008-06-111-5/+15
|
* Renamed PyBytes to PyByteArrayChristian Heimes2008-05-261-31/+31
|
* Merged revisions ↵Christian Heimes2008-04-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r62194 | jeffrey.yasskin | 2008-04-07 01:04:28 +0200 (Mon, 07 Apr 2008) | 7 lines Add enough debugging information to diagnose failures where the HandlerBException is ignored, and fix one such problem, where it was thrown during the __del__ method of the previous Popen object. We may want to find a better way of printing verbose information so it's not spammy when the test passes. ........ r62197 | mark.hammond | 2008-04-07 03:53:39 +0200 (Mon, 07 Apr 2008) | 2 lines Issue #2513: enable 64bit cross compilation on windows. ........ r62198 | mark.hammond | 2008-04-07 03:59:40 +0200 (Mon, 07 Apr 2008) | 2 lines correct heading underline for new "Cross-compiling on Windows" section ........ r62204 | gregory.p.smith | 2008-04-07 08:33:21 +0200 (Mon, 07 Apr 2008) | 4 lines Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly within the standard library. These modules use PyFile_AsFile and later release the GIL while operating on the previously returned FILE*. ........ r62205 | mark.summerfield | 2008-04-07 09:39:23 +0200 (Mon, 07 Apr 2008) | 4 lines changed "2500 components" to "several thousand" since the number keeps growning:-) ........ r62214 | georg.brandl | 2008-04-07 20:51:59 +0200 (Mon, 07 Apr 2008) | 2 lines #2525: update timezone info examples in the docs. ........ r62219 | andrew.kuchling | 2008-04-08 01:57:07 +0200 (Tue, 08 Apr 2008) | 1 line Write PEP 3127 section; add items ........ r62220 | andrew.kuchling | 2008-04-08 01:57:21 +0200 (Tue, 08 Apr 2008) | 1 line Typo fix ........ r62221 | andrew.kuchling | 2008-04-08 03:33:10 +0200 (Tue, 08 Apr 2008) | 1 line Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit ........ r62227 | andrew.kuchling | 2008-04-08 23:22:53 +0200 (Tue, 08 Apr 2008) | 1 line Add items ........ r62229 | amaury.forgeotdarc | 2008-04-08 23:27:42 +0200 (Tue, 08 Apr 2008) | 7 lines Issue2564: Prevent a hang in "import test.autotest", which runs the entire test suite as a side-effect of importing the module. - in test_capi, a thread tried to import other modules - re.compile() imported sre_parse again on every call. ........ r62230 | amaury.forgeotdarc | 2008-04-08 23:51:57 +0200 (Tue, 08 Apr 2008) | 2 lines Prevent an error when inspect.isabstract() is called with something else than a new-style class. ........ r62231 | amaury.forgeotdarc | 2008-04-09 00:07:05 +0200 (Wed, 09 Apr 2008) | 8 lines Issue 2408: remove the _types module It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType), when they can easily be obtained with python code. These expressions even work with Jython. I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 ) at least this change makes it simpler. ........ r62233 | amaury.forgeotdarc | 2008-04-09 01:10:07 +0200 (Wed, 09 Apr 2008) | 2 lines Add a NEWS entry for previous checkin ........ r62234 | trent.nelson | 2008-04-09 01:47:30 +0200 (Wed, 09 Apr 2008) | 37 lines - Issue #2550: The approach used by client/server code for obtaining ports to listen on in network-oriented tests has been refined in an effort to facilitate running multiple instances of the entire regression test suite in parallel without issue. test_support.bind_port() has been fixed such that it will always return a unique port -- which wasn't always the case with the previous implementation, especially if socket options had been set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT). The new implementation of bind_port() will actually raise an exception if it is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or SO_REUSEPORT socket option set. Furthermore, if available, bind_port() will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed. This currently only applies to Windows. This option prevents any other sockets from binding to the host/port we've bound to, thus removing the possibility of the 'non-deterministic' behaviour, as Microsoft puts it, that occurs when a second SOCK_STREAM socket binds and accepts to a host/port that's already been bound by another socket. The optional preferred port parameter to bind_port() has been removed. Under no circumstances should tests be hard coding ports! test_support.find_unused_port() has also been introduced, which will pass a temporary socket object to bind_port() in order to obtain an unused port. The temporary socket object is then closed and deleted, and the port is returned. This method should only be used for obtaining an unused port in order to pass to an external program (i.e. the -accept [port] argument to openssl's s_server mode) or as a parameter to a server-oriented class that doesn't give you direct access to the underlying socket used. Finally, test_support.HOST has been introduced, which should be used for the host argument of any relevant socket calls (i.e. bind and connect). The following tests were updated to following the new conventions: test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib, test_poplib, test_ftplib, test_telnetlib, test_socketserver, test_asynchat and test_socket_ssl. It is now possible for multiple instances of the regression test suite to run in parallel without issue. ........ r62235 | gregory.p.smith | 2008-04-09 02:25:17 +0200 (Wed, 09 Apr 2008) | 3 lines Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive. It tried to allocate negative or zero memory. That fails. ........ r62237 | trent.nelson | 2008-04-09 02:34:53 +0200 (Wed, 09 Apr 2008) | 1 line Fix typo with regards to self.PORT shadowing class variables with the same name. ........ r62238 | andrew.kuchling | 2008-04-09 03:08:32 +0200 (Wed, 09 Apr 2008) | 1 line Add items ........ r62239 | jerry.seutter | 2008-04-09 07:07:58 +0200 (Wed, 09 Apr 2008) | 1 line Changed test so it no longer runs as a side effect of importing. ........
* Merged revisions ↵Christian Heimes2008-03-251-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 61834,61841-61842,61851-61853,61863-61864,61869-61870,61874,61889 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r61834 | raymond.hettinger | 2008-03-24 07:07:49 +0100 (Mon, 24 Mar 2008) | 1 line Tighten documentation for Random.triangular. ........ r61841 | raymond.hettinger | 2008-03-24 09:17:39 +0100 (Mon, 24 Mar 2008) | 1 line Issue 2460: Make Ellipsis objects copyable. ........ r61842 | georg.brandl | 2008-03-24 10:34:34 +0100 (Mon, 24 Mar 2008) | 2 lines #1700821: add a note to audioop docs about signedness of sample formats. ........ r61851 | christian.heimes | 2008-03-24 20:57:42 +0100 (Mon, 24 Mar 2008) | 1 line Added quick hack for bzr ........ r61852 | christian.heimes | 2008-03-24 20:58:17 +0100 (Mon, 24 Mar 2008) | 1 line Added quick hack for bzr ........ r61853 | amaury.forgeotdarc | 2008-03-24 22:04:10 +0100 (Mon, 24 Mar 2008) | 4 lines Issue2469: Correct a typo I introduced at r61793: compilation error with UCS4 builds. All buildbots compile with UCS2... ........ r61863 | neal.norwitz | 2008-03-25 05:17:38 +0100 (Tue, 25 Mar 2008) | 2 lines Fix a bunch of UnboundLocalErrors when the tests fail. ........ r61864 | neal.norwitz | 2008-03-25 05:18:18 +0100 (Tue, 25 Mar 2008) | 2 lines Try to fix a bunch of compiler warnings on Win64. ........ r61869 | neal.norwitz | 2008-03-25 07:35:10 +0100 (Tue, 25 Mar 2008) | 3 lines Don't try to close a non-open file. Don't let file removal cause the test to fail. ........ r61870 | neal.norwitz | 2008-03-25 08:00:39 +0100 (Tue, 25 Mar 2008) | 7 lines Try to get this test to be more stable: * disable gc during the test run because we are spawning objects and there was an exception when calling Popen.__del__ * Always set an alarm handler so the process doesn't exit if the test fails (should probably add assertions on the value of hndl_called in more places) * Using a negative time causes Linux to treat it as zero, so disable that test. ........ r61874 | gregory.p.smith | 2008-03-25 08:31:28 +0100 (Tue, 25 Mar 2008) | 2 lines Use a 32-bit unsigned int here, a long is not needed. ........ r61889 | georg.brandl | 2008-03-25 12:59:51 +0100 (Tue, 25 Mar 2008) | 2 lines Move declarations to block start. ........
* Merged revisions 61820-61823 via svnmerge fromChristian Heimes2008-03-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r61820 | gregory.p.smith | 2008-03-23 23:14:38 +0100 (Sun, 23 Mar 2008) | 2 lines replace calls to get the initial values with the raw constants. ........ r61821 | gregory.p.smith | 2008-03-24 00:43:02 +0100 (Mon, 24 Mar 2008) | 2 lines A bugfix for r61813, it would fail if the data size was >=2**32. ........ r61822 | gregory.p.smith | 2008-03-24 00:45:12 +0100 (Mon, 24 Mar 2008) | 2 lines prevent a warning from the struct module when data size >= 2**32. ........ r61823 | gregory.p.smith | 2008-03-24 01:08:01 +0100 (Mon, 24 Mar 2008) | 4 lines Have the binascii module use zlib's optimized crc32() function when available to reduce our code size (1k data table and tiny bit of code). It falls back to its own without zlib. ........