Commit graph

3680 commits

Author SHA1 Message Date
Benjamin Peterson
52c424343d allow cycles throught the __dict__ slot to be cleared (closes #1469629)
Patch from Armin, test from me.
2012-03-07 18:41:11 -06:00
Antoine Pitrou
e965d97ed1 Issue #13521: dict.setdefault() now does only one lookup for the given key, making it "atomic" for many purposes.
Patch by Filip Gruszczyński.
2012-02-27 00:45:12 +01:00
Benjamin Peterson
e249dcab7a merge 3.2 2012-02-21 11:09:13 -05:00
Benjamin Peterson
69e9727657 ensure no one tries to hash things before the random seed is found 2012-02-21 11:08:50 -05:00
Georg Brandl
09a7c72cad Merge from 3.1: Issue #13703: add a way to randomize the hash values of basic types (str, bytes, datetime)
in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated.

The environment variable PYTHONHASHSEED and the new command line flag -R control this
behavior.
2012-02-20 21:31:46 +01:00
Georg Brandl
2daf6ae249 Issue #13703: add a way to randomize the hash values of basic types (str, bytes, datetime)
in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated.

The environment variable PYTHONHASHSEED and the new command line flag -R control this
behavior.
2012-02-20 19:54:16 +01:00
Benjamin Peterson
496c53d83e use Py_CLEAR 2012-02-19 01:11:56 -05:00
Antoine Pitrou
4b3c7846c9 Fix indentation 2012-02-15 02:52:58 +01:00
Antoine Pitrou
37784ba5c0 Issue #13020: Fix a reference leak when allocating a structsequence object fails.
Patch by Suman Saha.
2012-02-15 02:51:43 +01:00
Victor Stinner
cbe01342bc Issue #13913: normalize utf-8 codec name in UTF-8 decoder 2012-02-14 01:17:45 +01:00
Benjamin Peterson
efe7c9d4d7 this is only a borrowed ref in Brett's branch 2012-02-10 08:46:54 -05:00
Benjamin Peterson
2f9c71bbba bltinmod is borrowed, so it shouldn't be decrefed 2012-02-06 11:28:45 -05:00
Benjamin Peterson
90b13583bc put returns on their own lines 2012-02-03 19:22:31 -05:00
Benjamin Peterson
2652d2570e ready types returned from PyType_FromSpec 2012-01-29 20:16:37 -05:00
Benjamin Peterson
e28108cbd7 adjust declaration 2012-01-29 20:13:18 -05:00
Antoine Pitrou
1334884ff2 Issue #13848: open() and the FileIO constructor now check for NUL characters in the file name.
Patch by Hynek Schlawack.
2012-01-29 18:36:34 +01:00
Mark Dickinson
261896b559 Issue #13889: Add missing _Py_SET_53BIT_PRECISION_* calls around uses of dtoa.c functions in float round. 2012-01-27 21:16:01 +00:00
Georg Brandl
beca27a394 Fix #13834: strip() strips leading and trailing whitespace. 2012-01-22 21:31:21 +01:00
Antoine Pitrou
55f217f22d Fix refleaks in test_capi
(this was easier than I thought!)
2012-01-18 21:23:13 +01:00
Antoine Pitrou
1c7ade5284 Fix leaking a RuntimeError objects when creating sub-interpreters 2012-01-18 16:13:31 +01:00
Gregory P. Smith
63e6c3222f Consolidate the occurrances of the prime used as the multiplier when hashing
to a single #define instead of having several copies in several files.

This excludes the Modules/ tree (datetime and expat both have a copy
for their own purposes with no need for it to be the same).
2012-01-14 15:31:34 -08:00
Benjamin Peterson
53aa1d7c57 fix possible if unlikely leak 2011-12-20 13:29:45 -06:00
Georg Brandl
ac0675cc01 Small clarification in docstring of dict.update(): the positional argument is not required. 2011-12-18 19:30:55 +01:00
Victor Stinner
bb2e9c477d Issue #11231: Fix bytes and bytearray docstrings
Patch written by Brice Berna.
2011-12-17 23:18:07 +01:00
Antoine Pitrou
2e872082f6 Fix the fix for issue #12149: it was incorrect, although it had the side
effect of appearing to resolve the issue.  Thanks to Mark Shannon for
noticing.
2011-12-15 14:15:31 +01:00
Victor Stinner
ab1d16b456 Issue #13093: Fix error handling on PyUnicode_EncodeDecimal()
* Add tests for PyUnicode_EncodeDecimal() and PyUnicode_TransformDecimalToASCII()
 * Remove the unused "e" variable in replace()
2011-11-22 01:45:37 +01:00
Antoine Pitrou
5418ee0b9a Issue #13333: The UTF-7 decoder now accepts lone surrogates
(the encoder already accepts them).
2011-11-15 01:42:21 +01:00
Eli Bendersky
d3baae73be Issue #13161: fix doc strings of __i*__ operators 2011-11-11 16:57:05 +02:00
Petri Lehtinen
ebfaabd663 Revert "Accept None as start and stop parameters for list.index() and tuple.index()"
Issue #13340.
2011-11-06 21:02:39 +02:00
Petri Lehtinen
c2f0a46111 Accept None as start and stop parameters for list.index() and tuple.index()
Closes #13340.
2011-11-05 23:24:31 +02:00
Benjamin Peterson
2b50a01d11 remove unused variable 2011-10-30 14:24:44 -04:00
Petri Lehtinen
e0aa803714 Fix the return value of set_discard (issue #10519) 2011-10-30 14:35:12 +02:00
Petri Lehtinen
5acc27ebe4 Avoid unnecessary recursive function calls (closes #10519) 2011-10-30 13:56:41 +02:00
Petri Lehtinen
a94200e6ce Issue #13018: Fix reference leaks in error paths in dictobject.c.
Patch by Suman Saha.
2011-10-24 21:12:58 +03:00
Nick Coghlan
de31b191e5 Issue 1294232: Fix errors in metaclass calculation affecting some cases of metaclass inheritance. Patch by Daniel Urban. 2011-10-23 22:04:16 +10:00
Benjamin Peterson
9d9141f5db adjust braces a bit 2011-10-19 16:57:40 -04:00
Antoine Pitrou
551ba20e8e Issue #13188: When called without an explicit traceback argument,
generator.throw() now gets the traceback from the passed exception's
`__traceback__` attribute.  Patch by Petri Lehtinen.
2011-10-18 16:40:50 +02:00
Benjamin Peterson
2963fe0711 plug possible refleak (closes #13199) 2011-10-17 13:09:27 -04:00
Antoine Pitrou
eeb7eea1f9 Issue #12911: Fix memory consumption when calculating the repr() of huge tuples or lists.
This introduces a small private API for this common pattern.
The issue has been discovered thanks to Martin's huge-mem buildbot.
2011-10-06 18:57:27 +02:00
Mark Dickinson
c0420fd42a Issue #12973: Fix undefined-behaviour-inducing overflow check in list_repeat. 2011-09-19 19:18:37 +01:00
Stefan Krah
b77c6c65c0 Issue #12963: PyLong_AsSize_t() now returns (size_t)-1 in all error cases. 2011-09-12 16:22:47 +02:00
Victor Stinner
d88d9836c5 Fix PyUnicode_AsWideCharString() doc: size doesn't contain the null character
Fix also spelling of the null character.
2011-09-06 02:00:05 +02:00
Benjamin Peterson
eff61f6927 make sure to initialize the method wrapper type 2011-09-01 16:32:31 -04:00
Ezio Melotti
93e7afc5d9 #9200: The str.is* methods now work with strings that contain non-BMP characters even in narrow Unicode builds. 2011-08-22 14:08:38 +03:00
Antoine Pitrou
a370fcf3b2 Issue #12791: Break reference cycles early when a generator exits with an exception. 2011-08-20 14:15:03 +02:00
Benjamin Peterson
7a6b44ab62 the named of the character is actually NUL 2011-08-18 13:51:47 -05:00
Benjamin Peterson
5ad517a7d9 NUL -> NULL 2011-08-18 10:48:50 -05:00
Benjamin Peterson
ae13c88d8d fix possible refleaks 2011-08-16 22:26:48 -05:00
Ezio Melotti
ee8d998ecf #12266: Fix str.capitalize() to correctly uppercase/lowercase titlecased and cased non-letter characters. 2011-08-15 09:09:57 +03:00
Benjamin Peterson
f413b80806 in narrow builds, make sure to test codepoints as identifier characters (closes #12732)
This fixes the use of Unicode identifiers outside the BMP in narrow builds.
2011-08-12 22:17:18 -05:00