summaryrefslogtreecommitdiff
path: root/Modules/_struct.c
AgeCommit message (Collapse)AuthorLines
2018-07-31[2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)Serhiy Storchaka-3/+3
2017-05-15bpo-30242: resolve some undefined behaviours in struct (#1418) (#1588)Xiang Zhang-5/+9
2016-04-06Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka-2/+2
2015-12-27Issue #20440: Applied yet one patch for using Py_SETREF.Serhiy Storchaka-4/+2
The patch is automatically generated, it replaces the code that uses Py_CLEAR.
2015-12-19Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.Serhiy Storchaka-1/+1
This allows sys.getsize() to work correctly with their subclasses with __slots__ defined.
2015-02-21Issue #22113: struct.pack_into() now supports new buffer protocol (inSerhiy Storchaka-10/+12
particular accepts writable memoryview).
2013-12-08Issue #19099: The struct module now supports Unicode format strings.Serhiy Storchaka-4/+19
2013-03-19Issue #10212: Support new buffer interface for struct.unpack andKristján Valur Jónsson-10/+19
cStringIO
2012-10-29#14897: Enhance error messages of struct.pack and struct.pack_intoPetri Lehtinen-4/+14
Patch by Matti Mäki.
2012-07-28Issue #15402: Simplify Struct.__sizeof__ and make tests more precise.Meador Inge-6/+2
2012-07-23Issue #15402: Add a __sizeof__ method to struct.Struct.Meador Inge-0/+17
Initial patch by Serhiy Storchaka.
2011-03-15#11515: fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti-1/+1
2010-07-29Merged revisions 83239 via svnmerge fromMark Dickinson-0/+3
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83239 | mark.dickinson | 2010-07-29 22:41:59 +0100 (Thu, 29 Jul 2010) | 2 lines Issue #9422: Fix memory leak when re-initializing a struct.Struct object. ........
2010-07-18Merged revisions 82941,82943 via svnmerge fromMark Dickinson-2/+2
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82941 | mark.dickinson | 2010-07-18 08:29:02 +0100 (Sun, 18 Jul 2010) | 3 lines Issue #9277: Struct module: standard bool packing was incorrect if char is unsigned. Thanks Stefan Krah for the patch. ........ r82943 | mark.dickinson | 2010-07-18 08:48:20 +0100 (Sun, 18 Jul 2010) | 1 line Misc/NEWS entry for r82941. ........
2010-07-07Merged revisions 82628,82630 via svnmerge fromBenjamin Peterson-2/+8
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82628 | benjamin.peterson | 2010-07-07 13:44:05 -0500 (Wed, 07 Jul 2010) | 1 line this needn't be in the loop ........ r82630 | benjamin.peterson | 2010-07-07 13:54:59 -0500 (Wed, 07 Jul 2010) | 1 line don't ignore exceptions from PyObject_IsTrue ........
2010-06-11Fix possible undefined behaviour from signed overflow in struct module.Mark Dickinson-22/+29
Backport of revisions 81897, 81898 and 81902 from py3k.
2010-05-09Untabify C files. Will watch buildbots.Antoine Pitrou-1216/+1216
2010-04-04A handful of whitespace fixes in Modules/_struct.c.Mark Dickinson-20/+20
2010-04-04Issue #8300 (__index__ handling in struct.pack): Remove redundant checkMark Dickinson-6/+1
and improve test coverage. Thanks Meador Inge for the patch.
2010-04-03Issue #8300: Let struct.pack use __index__ to convert and pack non-integers.Mark Dickinson-11/+39
Based on a patch by Meador Inge.
2010-03-07Silence compiler warning.Mark Dickinson-1/+4
2010-03-07Issue #1530559: When packing a non-integer with any integer conversionMark Dickinson-12/+52
code using struct.pack, attempt to convert to an integer first using the argument's __int__ method (if present). Also raise a DeprecationWarning for any such usage of __int__. This fixes a regression from 2.6, where some (but not all) integer conversion codes already used __int__.
2010-03-05Remove the redundant #define: PY_STRUCT_FLOAT_COERCEMark Dickinson-13/+0
2010-03-05Fix incorrect stacklevel for DeprecationWarnings originating from the struct ↵Mark Dickinson-1/+1
module. Also clean up related tests in test_struct. The stacklevel fix should be backported to 2.6 once that branch is unfrozen.
2009-10-08Issue #7078: _struct.__doc__ was being ignored. Import it into struct.Mark Dickinson-8/+10
Also add description of '?' struct format character. Thanks Gabriel Genellina for the patch.
2009-09-27Eliminate unnecessary get_wrapped_(u)long defines in struct module.Mark Dickinson-9/+6
2009-07-07Issue #1523: Remove deprecated overflow masking in struct module, andMark Dickinson-219/+32
make sure that out-of-range values consistently raise struct.error.
2009-07-07Typo in error messageMark Dickinson-1/+1
2009-07-05Issues #1530559, #1741130: Fix various inconsistencies in struct.packMark Dickinson-109/+107
integer packing, and reenable some previously broken tests.
2009-05-29Fix nearly all compilation warnings under Apple gcc-4.0. Tested with OPT="-gJeffrey Yasskin-0/+2
-Wall -Wstrict-prototypes -Werror" in both --with-pydebug mode and --without. There's still a batch of non-prototype warnings in Xlib.h that I don't know how to fix.
2009-01-01#4228: Pack negative values the same way as 2.4Georg Brandl-6/+6
in struct's L format.
2008-09-30Victor Stinner's patches to check the return result of PyLong_Ssize_tBenjamin Peterson-0/+2
reviewed by Amaury
2008-06-11Merge in release25-maint r60793:Gregory P. Smith-0/+6
Added checks for integer overflows, contributed by Google. Some are only available if asserts are left in the code, in cases where they can't be triggered from Python code.
2008-06-09This reverts r63675 based on the discussion in this thread:Gregory P. Smith-19/+19
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.
2008-05-26Renamed PyString to PyBytesChristian Heimes-19/+19
2008-03-05Issue 1872: Changed the struct module typecode from 't' to '?', forThomas Heller-3/+3
compatibility with PEP3118.
2008-02-16Crashers of the day: Py_CLEAR must be used when there is a chance that theAmaury Forgeot d'Arc-1/+1
function can be called recursively. This was discussed in issue1020188. In python codebase, all occurrences of Py_[X]DECREF(xxx->yyy) are suspect, except when they appear in tp_new or tp_dealloc functions, or when the member cannot be of a user-defined class. Note that tp_init is not safe. I do have a (crashing) example for every changed line. Is it worth adding them to the test suite? Example: class SpecialStr(str): def __del__(self): s.close() import cStringIO s = cStringIO.StringIO(SpecialStr("text")) s.close() # Segfault
2008-01-18clearcache() needs to remove the dict as well as clear it.Raymond Hettinger-2/+1
2008-01-04Added _struct._clearcache() for regression testsChristian Heimes-1/+13
2008-01-04Finish-up the struct module optimizations started at the Iceland NFS sprint.Raymond Hettinger-1/+205
2007-12-19#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes-4/+4
Py_REFCNT. Macros for b/w compatibility are available.
2007-07-21PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis-6/+5
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
2007-05-22Stop using METH_OLDARGS implicitlyNeal Norwitz-1/+1
2007-04-25Make pythoncore compile cleanly with VisualStudio 2005. Used an explicit ↵Kristján Valur Jónsson-2/+2
typecast to get a 64 bit integer, and undefined the Yield macro that conflicts with winbase.h
2007-04-05Bug #1563759: struct.unpack doens't support buffer protocol objectsRaymond Hettinger-7/+25
2007-01-21Patch #1610575: Add support for _Bool to struct.Martin v. Löwis-0/+49
2006-08-04Fix #1530559, struct.pack raises TypeError where it used to convert.Bob Ippolito-0/+60
Passing float arguments to struct.pack when integers are expected now triggers a DeprecationWarning.
2006-07-30Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().Neal Norwitz-4/+6
This provides the proper warning for struct.pack(). PyErr_Warn() is now deprecated in favor of PyErr_WarnEx(). As mentioned by Tim Peters on python-dev.
2006-06-11Wrap some long linesNeal Norwitz-15/+10
Top/Bottom factor out some common expressions Add a XXX comment about widing offset.
2006-06-04s_methods[]: Stop compiler warnings by castingTim Peters-1/+2
s_unpack_from to PyCFunction.