summaryrefslogtreecommitdiffstats
path: root/Modules/bz2module.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #3139: Make buffer-interface thread-safe wrt. PyArg_ParseTuple,Martin v. Löwis2008-08-121-10/+48
| | | | | | | by denying s# to parse objects that have a releasebuffer procedure, and introducing s*. More module might need to get converted to use s*.
* #3205: bz2 iterator fails silently on MemoryErrorAntoine Pitrou2008-08-091-0/+1
|
* - Issue #3309: Fix bz2.BZFile itererator to release its internal lockGregory P. Smith2008-07-071-0/+1
| | | | | properly when raising an exception due to the bz2file being closed. Prevents a deadlock.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-54/+54
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-54/+54
|
* fix compiler warningsGregory P. Smith2008-04-121-5/+5
|
* Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatlyGregory P. Smith2008-04-071-0/+15
| | | | | within the standard library. These modules use PyFile_AsFile and later release the GIL while operating on the previously returned FILE*.
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-7/+7
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* issue1597011: Fix for bz2 module corner-case error due to error checking bug.Sean Reifscheider2007-09-171-23/+17
|
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-13/+10
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Bug #1622896: fix a rare corner case where the bz2 module raised anGeorg Brandl2007-03-131-10/+11
| | | | error in spite of a succesful compression.
* [Patch #1615868 by Lars Gustaebel] Use Py_off_t to fix BZ2File.seek() for ↵Andrew M. Kuchling2006-12-181-1/+1
| | | | offsets > 2Gb
* Remove extra semi-colons reported by Johnny Lee on python-dev. Backport if ↵Neal Norwitz2006-09-231-2/+2
| | | | anyone cares.
* Patch #1535500: fix segfault in BZ2File.writelines and make sure itGeorg Brandl2006-08-141-2/+17
| | | | raises the correct exceptions.
* Fix more memory allocation issues found with failmalloc.Neal Norwitz2006-07-221-8/+20
|
* Patch #1516912: improve Modules support for OpenVMS.Neal Norwitz2006-07-101-0/+4
|
* Fix some Py_ssize_t issuesNeal Norwitz2006-06-121-5/+5
|
* Revert backwards-incompatible const changes.Martin v. Löwis2006-02-271-3/+3
|
* Remove unused variableNeal Norwitz2006-02-181-1/+0
|
* Bug #1366000: cleanup BZ2File.seek() logic. Fixes the case of whence=2, ↵Georg Brandl2006-02-181-42/+33
| | | | offset>=0.
* Merge ssize_t branch.Martin v. Löwis2006-02-151-1/+1
|
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* SF Bug #1407069, Remove extra semi-colon if there is no long longNeal Norwitz2006-01-171-1/+1
|
* Add const to several API functions that take char *.Jeremy Hylton2005-12-101-4/+4
| | | | | | | | | | | | | | | | | | | In C++, it's an error to pass a string literal to a char* function without a const_cast(). Rather than require every C++ extension module to put a cast around string literals, fix the API to state the const-ness. I focused on parts of the API where people usually pass literals: PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type slots, etc. Predictably, there were a large set of functions that needed to be fixed as a result of these changes. The most pervasive change was to make the keyword args list passed to PyArg_ParseTupleAndKewords() to be a const char *kwlist[]. One cast was required as a result of the changes: A type object mallocs the memory for its tp_doc slot and later frees it. PyTypeObject says that tp_doc is const char *; but if the type was created by type_new(), we know it is safe to cast to char *.
* bug [ 1274069 ] bz2module.c compiler warningGeorg Brandl2005-09-031-5/+12
|
* Fix BZ2File.(x)readlines() for files without a newline.Georg Brandl2005-08-211-8/+31
|
* Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.Georg Brandl2005-06-031-0/+4
|
* Add error checks for the bz2, cStringIO and operator modules.Walter Dörwald2004-11-011-4/+4
| | | | Add function names to various PyArg_ParseTuple calls in bz2module.c.
* - Fixed #853061: allow BZ2Compressor.compress() to receive an empty stringGustavo Niemeyer2004-02-141-0/+3
| | | | as parameter.
* Remove support for --without-universal-newlines (see PEP 11).Skip Montanaro2004-02-071-22/+0
|
* Use appropriate macros not the deprecated DL_IMPORT/DL_EXPORT macrosNeal Norwitz2003-07-011-1/+1
|
* Patch #708495: Port more stuff to OpenVMS.Martin v. Löwis2003-05-031-0/+2
|
* Applying patch #728656, by logistix, fixing opening of nonexistentGustavo Niemeyer2003-04-291-1/+1
| | | | bz2 files. Also, included a testcase for this problem.
* Applying patch by Neal Norwitz:Gustavo Niemeyer2003-04-271-0/+25
| | | | [#727759] get bzip2 to build on Solaris 8 (old bzip library)
* Rename LONG_LONG to PY_LONG_LONG. Fixes #710285.Martin v. Löwis2003-03-291-4/+4
|
* Unparenting BZ2File, as discussed in SF patch #661796.Gustavo Niemeyer2003-02-111-102/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Modules/bz2module.c (BZ2FileObject): Now the structure includes a pointer to a file object, instead of "inheriting" one. Also, some members were copied from the PyFileObject structure to avoid dealing with the internals of that structure from outside fileobject.c. (Util_GetLine,Util_DropReadAhead,Util_ReadAhead,Util_ReadAheadGetLineSkip, BZ2File_write,BZ2File_writelines,BZ2File_init,BZ2File_dealloc, BZ2Comp_dealloc,BZ2Decomp_dealloc): These functions were adapted to the change above. (BZ2File_seek,BZ2File_close): Use PyObject_CallMethod instead of getting the function attribute locally. (BZ2File_notsup): Removed, since it's not necessary anymore to overload truncate(), and readinto() with dummy functions. (BZ2File_methods): Added xreadlines() as an alias to BZ2File_getiter, and removed truncate() and readinto(). (BZ2File_get_newlines,BZ2File_get_closed,BZ2File_get_mode,BZ2File_get_name, BZ2File_getset): Implemented getters for "newlines", "mode", and "name". (BZ2File_members): Implemented "softspace" member. (BZ2File_init): Reworked to create a file instance instead of initializing itself as a file subclass. Also, pass "name" object untouched to the file constructor, and use PyObject_CallFunction instead of building the argument tuple locally. (BZ2File_Type): Set tp_new to PyType_GenericNew, tp_members to BZ2File_members, and tp_getset to BZ2File_getset. (initbz2): Do not set BZ2File_Type.tp_base nor BZ2File_Type.tp_new. * Doc/lib/libbz2.tex Do not mention that BZ2File inherits from the file type.
* Patch #661760: Cygwin auto-import module patchJason Tishler2003-01-061-29/+14
| | | | | | | | | | | | The attached patch enables shared extension modules to build cleanly under Cygwin without moving the static initialization of certain function pointers (i.e., ones exported from the Python DLL core) to a module initialization function. Additionally, this patch fixes the modules that have been changed in the past to accommodate Cygwin.
* Patch #649060: Cygwin bz2module patchJason Tishler2002-12-051-14/+29
| | | | This patch enables the bz2 module to build cleanly under Cygwin.
* Include Python.h first.Martin v. Löwis2002-11-231-1/+1
|
* bz2_compress/bz2_decompress: more casting away LONG_LONG forTim Peters2002-11-091-2/+2
| | | | _PyString_Resize calls.
* BZ2Decomp_decompress(): Fixed more long vs LONG_LONG confusions.Tim Peters2002-11-091-2/+2
|
* BZ2Comp_flush(): Fixed more int vs LONG_LONG confusions.Tim Peters2002-11-091-2/+2
|
* BZ2Comp_compress(): Explicitly cast the LONG_LONG size argument toTim Peters2002-11-091-1/+1
| | | | _PyString_Resize to int.
* BZ2Comp_compress(): changed decl of totalout to LONG_LONG, since it'sTim Peters2002-11-091-1/+1
| | | | | solely used to hold LONG_LONG values, and the compiler rightfully warns about potential data loss otherwise.
* Repaired signed-vs-unsigned mismatch.Tim Peters2002-11-091-1/+1
|
* This couldn't compile on WIndows, due to hardcoded "long long". Repaired.Tim Peters2002-11-091-23/+23
|
* * Modules/bz2module.cGustavo Niemeyer2002-11-081-12/+21
| | | | | (BZ2File_dealloc): Call Util_DropReadAhead(). (*): Included aesthetic changes by Neal Norwitz.
* * bzmodule.cGustavo Niemeyer2002-11-051-3/+3
| | | | More fixes of XDECREF'd values not initialized.
* Fix SF #633935, test_bz2 failsNeal Norwitz2002-11-051-1/+1
| | | | | Needed to init ret since it was Py_XDECREF()d on error. All regressions pass in debug build for me.
* Patch implementing bz2 module.Gustavo Niemeyer2002-11-051-0/+2099
* setup.py (PyBuildExt.detect_modules): Included bz2 module detection. * Modules/bz2module.c * Lib/test/test_bz2.py * Doc/lib/libbz2.tex Included files implementing, testing, and documenting bz2 module. * Doc/Makefile.deps * Doc/lib/lib.tex Include references to libbz2.tex. * Misc/NEWS (Library): Mention distutils' c++ linkage patch, and new bz2 module.