summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* PyUnicode_AsUTF8String(): /F picks up what I missed: the local varBarry Warsaw2000-08-181-2/+0
| | | | `str' is no longer necessary. Gotta turn on -Wall!
* PyUnicode_AsUTF8String(): Don't need to explicitly incref str sinceBarry Warsaw2000-08-181-7/+3
| | | | | PyUnicode_EncodeUTF8() already returns the created object with the proper reference count. This fixes an Insure reported memory leak.
* make_pair(): When comparing the pointers, they must be cast to integerBarry Warsaw2000-08-181-2/+6
| | | | | | types (i.e. Py_uintptr_t, our spelling of C9X's uintptr_t). ANSI specifies that pointer compares other than == and != to non-related structures are undefined. This quiets an Insure portability warning.
* PyFloat_FromString(): Move s_buffer[] up to the top-level functionBarry Warsaw2000-08-181-2/+1
| | | | | | scope. Previously, s_buffer[] was defined inside the PyUnicode_Check() scope, but referred to in the outer scope via assignment to s. This quiets an Insure portability warning.
* PyInstance_DoBinOp(): When comparing the pointers, they must be castBarry Warsaw2000-08-181-1/+4
| | | | | | | to integer types (i.e. Py_uintptr_t, our spelling of C9X's uintptr_t). ANSI specifies that pointer compares other than == and != to non-related structures are undefined. This quiets an Insure portability warning.
* Apply SF patch #101029: call __getitem__ with a proper slice object if thereThomas Wouters2000-08-172-9/+97
| | | | | | | | is no __getslice__ available. Also does the same for C extension types. Includes rudimentary documentation (it could use a cross reference to the section on slice objects, I couldn't figure out how to do that) and a test suite for all Python __hooks__ I could think of, including the new behaviour.
* Insure properly identifies the `interned' dictionary as leaking atBarry Warsaw2000-08-161-0/+12
| | | | | | shutdown time, but CVS log entry for revision 2.45 explains why this is so. Simply include a comment so we don't have to re-figure it out again 5 years from now.
* Updated commentAndrew M. Kuchling2000-08-161-1/+1
|
* Fix for http://sourceforge.net/bugs/?func=detailbug&bug_id=111866&group_id=5470.Tim Peters2000-08-154-100/+74
| | | | | | | | | | | This was a misleading bug -- the true "bug" was that hash(x) gave an error return when x is an infinity. Fixed that. Added new Py_IS_INFINITY macro to pyport.h. Rearranged code to reduce growing duplication in hashing of float and complex numbers, pushing Trent's earlier stab at that to a logical conclusion. Fixed exceedingly rare bug where hashing of floats could return -1 even if there wasn't an error (didn't waste time trying to construct a test case, it was simply obvious from the code that it *could* happen). Improved complex hash so that hash(complex(x, y)) doesn't systematically equal hash(complex(y, x)) anymore.
* Fixed a couple of instances where a 0-length string was beingMarc-André Lemburg2000-08-141-6/+13
| | | | | | | resized after creation. 0-length strings are usually shared and _PyString_Resize() fails on these shared strings. Fixes [ Bug #111667 ] unicode core dump.
* Check for overflow in list object insertion and raise OverflowError.Trent Mick2000-08-131-0/+5
| | | | see: http://www.python.org/pipermail/python-dev/2000-August/014971.html
* Clean up warning from Monterey compiler.Trent Mick2000-08-121-1/+1
| | | | | | Properly end a comment block. It was terminated fine later but by a subsequent block and. It was also in #if 0. This patch is so trivial I can't believe I am talking about it. :)
* Clean up a warning on Win64. The downcast of the strlen size_tTrent Mick2000-08-121-1/+1
| | | | | return value to int is safe here because it previously checked that there will be no overflow.
* Add the current Win64 compiler to the list of those that need theTrent Mick2000-08-121-1/+5
| | | | | huge switch statement broken up. This will probably not be necessary when the Win64 compiler matures.
* Add largefile support for Linux64 and WIn64. Add test_largefile and some minorTrent Mick2000-08-111-37/+145
| | | | | | | | | | change to regrtest.py to allow optional running of test_largefile ('cause it's slow on Win64). This closes patches: http://sourceforge.net/patch/index.php?func=detailpatch&patch_id=100510&group_id=5470 and http://sourceforge.net/patch/index.php?func=detailpatch&patch_id=100511&group_id=5470
* Fix missing decrements of the recursive counter in PyObject_Compare().Vladimir Marangozov2000-08-111-6/+12
| | | | Closes Patch #101065.
* Barry's patch to implement the new setdefault() method.Guido van Rossum2000-08-081-0/+36
|
* Removing UTF-16 aware Unicode comparison code. This kind of compareMarc-André Lemburg2000-08-081-0/+33
| | | | | | | function (together with other locale aware ones) should into a new collation support module. See python-dev for a discussion of this removal. Note: This patch should also be applied to the 1.6 branch.
* Removing warnings found by gcc -WallMoshe Zadka2000-08-042-4/+9
|
* Boost buffer sizes in the absence of snprintf on Windows.Tim Peters2000-08-041-14/+19
| | | | Ensure that # of args to sprintf always matches # of format specifiers.
* snprintf() is not portable, so continue to use sprintf() until a portableFred Drake2000-08-041-8/+6
| | | | snprintf() is available.
* This patch finalizes the move from UTF-8 to a default encoding inMarc-André Lemburg2000-08-031-40/+40
| | | | | | | | | | | | | | | | | | the Python Unicode implementation. The internal buffer used for implementing the buffer protocol is renamed to defenc to make this change visible. It now holds the default encoded version of the Unicode object and is calculated on demand (NULL otherwise). Since the default encoding defaults to ASCII, this will mean that Unicode objects which hold non-ASCII characters will no longer work on C APIs using the "s" or "t" parser markers. C APIs must now explicitly provide Unicode support via the "u", "U" or "es"/"es#" parser markers in order to work with non-ASCII Unicode strings. (Note: this patch will also have to be applied to the 1.6 branch of the CVS tree.)
* Remove the tp_print handler.Fred Drake2000-08-031-31/+27
| | | | | Revise the tp_repr handler to produce a more "minimal" presentation. Make the tolist() method use PyArg_ParseTuple() and provide a docstring.
* Remobe beopen/cnri/cwi copyrights, according to CNRI instructions.Guido van Rossum2000-08-031-10/+0
| | | | | | This doesn't change the copyright status for these files -- just the markings! Doing it on the main branch for these three files for which the HEAD revision was pushed back into 1.6.
* Changing the CNRI copyright notice according to CNRI's instructions.Guido van Rossum2000-08-032-2/+2
| | | | | This is a notice without a date, which apparently is not a claim to copyright but only advice to the reader. IANAL. :-)
* merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp2000-07-316-7/+0
| | | | marked my*.h as obsolete
* Use 'void' directly instead of the ANY #define, now that all code is ANSI C.Thomas Wouters2000-07-252-10/+10
| | | | Leave the actual #define in for API compatibility.
* ANSIfy functions that were hiding inside a macro.Thomas Wouters2000-07-231-1/+1
|
* ANSIfication: remove very-old-varargs code, fix function declarations soThomas Wouters2000-07-221-34/+0
| | | | they include prototypes.
* Miscelaneous ANSIfications. I'm assuming here 'main' should take (int,Thomas Wouters2000-07-222-21/+5
| | | | | char**) and return an int even on PC platforms. If not, please fix PC/utils/makesrc.c ;-P
* Fixed problems with UTF error reporting macros and some formatting bugs.Marc-André Lemburg2000-07-171-45/+64
|
* Restore PyXXX_Length() APIs for binary compatibility.Marc-André Lemburg2000-07-171-0/+24
| | | | | | New code will see the macros and therefore use the PyXXX_Size() APIs instead. By Thomas Wouters.
* gcc is being stupid with if/else constructsGreg Stein2000-07-171-6/+14
| | | | clean out some other warnings
* stop messing around with goto and just write the macro correctly.Greg Stein2000-07-161-7/+6
|
* - change \x to mean "byte" also in unicode literalsFredrik Lundh2000-07-161-3/+5
| | | | (patch #100912)
* Fix fatal compiler (MSVC6) error:Tim Peters2000-07-161-0/+1
| | | | | unicodeobject.c(735) : error C2143: syntax error : missing ';' before '}'
* Fix to a bug found by Florian Weimer:Marc-André Lemburg2000-07-161-1/+2
| | | | | | | | | | | | | | | | The UTF-8 decoder is still buggy (i.e. it doesn't pass Markus Kuhn's stress test), mainly due to the following construct: #define UTF8_ERROR(details) do { \ if (utf8_decoding_error(&s, &p, errors, details)) \ goto onError; \ continue; \ } while (0) (The "continue" statement is supposed to exit from the outer loop, but of course, it doesn't. Indeed, this is a marvelous example of the dangers of the C programming language and especially of the C preprocessor.)
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-166-12/+12
| | | | | | | | | | comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
* Fix in PyList_New(). With GC enabled and when out of memory,Vladimir Marangozov2000-07-151-1/+1
| | | | free() the GC pointer, not the object pointer.
* Added PyObject_AsFileDescriptor, which checks for integer, long integer,Andrew M. Kuchling2000-07-131-0/+58
| | | | or .fileno() method
* Propagate the current exception in get_inprogress_dict() -- it doesn'tVladimir Marangozov2000-07-121-1/+0
| | | | need to be cleared.
* replace PyXXX_Length calls with PyXXX_Size callsJeremy Hylton2000-07-123-4/+4
|
* change abstract size functions PySequence_Size &c.Jeremy Hylton2000-07-122-9/+9
| | | | add macros for backwards compatibility with C source
* Fix typo in error messageAndrew M. Kuchling2000-07-121-1/+1
|
* Include macglue.h on the macintosh, so function prototypes are in scope.Jack Jansen2000-07-111-0/+4
|
* small updates to string_join:Jeremy Hylton2000-07-111-6/+9
| | | | | | | use PyString_AS_STRING macro on local string object when resizing string, make sure resized string will always be big enough split string containing error message across two lines add test to string_tests that causes resizing
* Jeremy Hylton:Marc-André Lemburg2000-07-111-2/+4
| | | | better error message for unicode coercion failure
* string_join(): Some cleaning up of reference counting. In theBarry Warsaw2000-07-111-7/+10
| | | | | | | | seqlen==1 clause, before returning item, we need to DECREF seq. In the res=PyString... failure clause, we need to goto finally to also decref seq (and the DECREF of res in finally is changed to a XDECREF). Also, we need to DECREF seq just before the PyUnicode_Join() return.
* fix two refcount bugs in new string_join implementation:Jeremy Hylton2000-07-111-6/+2
| | | | | 1. PySequence_Fast_GET_ITEM is a macro and borrows a reference 2. The seq returned from PySequence_Fast must be decref'd
* two changes to string_join:Jeremy Hylton2000-07-101-82/+42
| | | | | | implementation -- use PySequence_Fast interface to iterate over elements interface -- if instance object reports wrong length, ignore it; previous version raised an IndexError if reported length was too high