summaryrefslogtreecommitdiffstats
path: root/Objects/bufferobject.c
Commit message (Collapse)AuthorAgeFilesLines
* - Issue #13703: oCERT-2011-003: add -R command-line option and PYTHONHASHSEEDBarry Warsaw2012-02-211-1/+11
| | | | | | environment variable, to provide an opt-in way to protect against denial of service attacks due to hash collisions within the dict and set types. Patch by David Malcolm, based on work by Victor Stinner.
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-673/+673
| | | | | | | | | | 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. ........
* Change the warning emitted for using the buffer() object; memoryview() in 3.0Brett Cannon2008-08-081-2/+1
| | | | is not an equivalent.
* Security patches from Apple: prevent int overflow when allocating memoryNeal Norwitz2008-07-311-0/+4
|
* Merge in release25-maint r60793:Gregory P. Smith2008-06-111-1/+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.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-13/+13
| | | | | | | 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-13/+13
|
* Use PyErr_WarnPy3k throughoutBenjamin Peterson2008-04-271-3/+1
|
* Move declarations to block start.Georg Brandl2008-03-251-4/+4
|
* Make Py3k warnings consistent w.r.t. punctuation; also respect theGeorg Brandl2008-03-251-1/+2
| | | | EOL 80 limit and supply more alternatives in warning messages.
* #2355: py3k warning for buffer().Georg Brandl2008-03-251-0/+5
|
* Coverity #151: Remove deadcode.Neal Norwitz2007-10-041-13/+0
| | | | All this code already exists above starting at line 653.
* Improve extended slicing support in builtin types and classes. Specifically:Thomas Wouters2007-08-281-1/+154
| | | | | | | | | | | | | | | | | | | | - Specialcase extended slices that amount to a shallow copy the same way as is done for simple slices, in the tuple, string and unicode case. - Specialcase step-1 extended slices to optimize the common case for all involved types. - For lists, allow extended slice assignment of differing lengths as long as the step is 1. (Previously, 'l[:2:1] = []' failed even though 'l[:2] = []' and 'l[:2:None] = []' do not.) - Implement extended slicing for buffer, array, structseq, mmap and UserString.UserString. - Implement slice-object support (but not non-step-1 slice assignment) for UserString.MutableString. - Add tests for all new functionality.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-2/+1
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Bug #1733488: Fix compilation of bufferobject.c on AIX.Martin v. Löwis2007-06-081-1/+1
| | | | Will backport to 2.5.
* memcmp() can return values other than -1, 0, and +1 but tp_compareThomas Heller2006-08-081-1/+1
| | | | must not.
* Suppress warning on MacOSX about possible use before set of proc.Skip Montanaro2006-06-101-1/+1
|
* Fix inconsistency in naming within an enum.Brett Cannon2006-06-091-12/+12
|
* Buffer objects would return the read or write buffer for a wrapped object whenBrett Cannon2006-06-081-22/+71
| | | | | | | | | the char buffer was requested. Now it actually returns the char buffer if available or raises a TypeError if it isn't (as is raised for the other buffer types if they are not present but requested). Not a backport candidate since it does change semantics of the buffer object (although it could be argued this is enough of a bug to bother backporting).
* More C++-compliance. Note especially listobject.c - to get C++ to accept theAnthony Baxter2006-04-111-2/+2
| | | | | | | | | PyTypeObject structures, I had to make prototypes for the functions, and move the structure definition ahead of the functions. I'd dearly like a better way to do this - to change this would make for a massive set of changes to the codebase. There's still some warnings - this is purely to get rid of errors first.
* Use proper PyArg_Parse format char for Py_ssize_t, instead of 'l', inThomas Wouters2006-02-161-1/+1
| | | | | buffer_new(). Probably fixes a bug in 'buffer("", 10, 10)' on platforms where sizeof(Py_ssize_t) != sizeof(long) (Win64?)
* Revert 42400.Martin v. Löwis2006-02-161-3/+3
|
* Support %zd in PyErr_Format and PyString_FromFormat.Martin v. Löwis2006-02-161-2/+2
|
* Get rid of compiler warnings (gcc 3.3.4 on x86)Neal Norwitz2006-02-161-3/+3
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-61/+63
|
* Check return result for errorNeal Norwitz2005-12-181-0/+2
|
* Disallow keyword arguments for type constructors that don't use them.Georg Brandl2005-08-261-1/+4
| | | | (fixes bug #1119418)
* Ensure negative offsets cannot be passed to buffer(). When composingNeil Schemenauer2004-09-241-2/+15
| | | | | buffers, compute the new buffer size based on the old buffer size. Fixes SF bug #1034242.
* Fix buffer offset calculation (need to compute it before changingNeil Schemenauer2004-09-241-11/+7
| | | | | 'base'). Fixes SF bug #1033720. Move offset sanity checking to buffer_from_memory().
* Correct code to advance ptr to be well-formed C.Martin v. Löwis2004-03-251-1/+1
|
* Make buffer objects based on mutable objects (like array) safe.Neil Schemenauer2004-03-111-82/+149
|
* Document one of the many problems with the buffer object.Neil Schemenauer2004-03-111-2/+9
|
* Rename static functions, they should not have the _Py prefix.Neil Schemenauer2004-03-111-11/+10
|
* Call me anal, but there was a particular phrase that was speading toGuido van Rossum2002-08-191-1/+1
| | | | | | | comments everywhere that bugged me: /* Foo is inlined */ instead of /* Inline Foo */. Somehow the "is inlined" phrase always confused me for half a second (thinking, "No it isn't" until I added the missing "here"). The new phrase is hopefully unambiguous.
* Fix SF bug 546434 -- buffer slice type inconsistent.Raymond Hettinger2002-06-251-13/+0
|
* SF patch 568629 by Oren Tirosh: types made callable.Guido van Rossum2002-06-141-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These built-in functions are replaced by their (now callable) type: slice() buffer() and these types can also be called (but have no built-in named function named after them) classobj (type name used to be "class") code function instance instancemethod (type name used to be "instance method") The module "new" has been replaced with a small backward compatibility placeholder in Python. A large portion of the patch simply removes the new module from various platform-specific build recipes. The following binary Mac project files still have references to it: Mac/Build/PythonCore.mcp Mac/Build/PythonStandSmall.mcp Mac/Build/PythonStandalone.mcp [I've tweaked the code layout and the doc strings here and there, and added a comment to types.py about StringTypes vs. basestring. --Guido]
* Remove the CACHE_HASH and INTERN_STRINGS preprocessor symbols.Tim Peters2002-03-291-10/+0
|
* Fix for Bug #216405:Thomas Heller2001-10-191-4/+6
| | | | use the correct base for a buffer object in _PyBuffer_FromObject.
* repr's converted to using PyString_FromFormat() instead of sprintf'ingBarry Warsaw2001-08-241-13/+7
| | | | | | into a hardcoded char* buffer. Closes patch #454743.
* Merge of descr-branch back into trunk.Tim Peters2001-08-021-17/+17
|
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Removing warnings found by gcc -WallMoshe Zadka2000-08-041-4/+5
|
* ANSI-fication of the sources.Fred Drake2000-07-091-78/+24
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-301-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The common technique for printing out a pointer has been to cast to a long and use the "%lx" printf modifier. This is incorrect on Win64 where casting to a long truncates the pointer. The "%p" formatter should be used instead. The problem as stated by Tim: > Unfortunately, the C committee refused to define what %p conversion "looks > like" -- they explicitly allowed it to be implementation-defined. Older > versions of Microsoft C even stuck a colon in the middle of the address (in > the days of segment+offset addressing)! The result is that the hex value of a pointer will maybe/maybe not have a 0x prepended to it. Notes on the patch: There are two main classes of changes: - in the various repr() functions that print out pointers - debugging printf's in the various thread_*.h files (these are why the patch is large) Closes SourceForge patch #100505.
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-4/+4
| | | | | | | | | | For more comments, read the patches@python.org archives. For documentation read the comments in mymalloc.h and objimpl.h. (This is not exactly what Vladimir posted to the patches list; I've made a few changes, and Vladimir sent me a fix in private email for a problem that only occurs in debug mode. I'm also holding back on his change to main.c, which seems unnecessary to me.)
* PyBuffer_New(): Raise ValueError if size is negative (the otherFred Drake1999-08-041-1/+6
| | | | | | | constructors didn't miss this). Raise MemoryError if malloc() fails, instead of just returning NULL.
* Folded long lines.Guido van Rossum1999-03-241-9/+18
|
* Added check for negative offset for PyBuffer_FromObject and check forGuido van Rossum1999-03-191-1/+13
| | | | negative size for PyBuffer_FromMemory. Greg Stein.