Victor Stinner
bfd316e750
Add _PyThreadState_UncheckedGet()
Issue #26154 : Add a new private _PyThreadState_UncheckedGet() function which
gets the current thread state, but don't call Py_FatalError() if it is NULL.
Python 3.5.1 removed the _PyThreadState_Current symbol from the Python C API to
no more expose complex and private atomic types. Atomic types depends on the
compiler or can even depend on compiler options. The new function
_PyThreadState_UncheckedGet() allows to get the variable value without having
to care of the exact implementation of atomic types.
Changes:
* Replace direct usage of the _PyThreadState_Current variable with a call to
_PyThreadState_UncheckedGet().
* In pystate.c, replace direct usage of the _PyThreadState_Current variable
with the PyThreadState_GET() macro for readability.
* Document also PyThreadState_Get() in pystate.h
11 years ago
Serhiy Storchaka
d205d0145c
Issue #25935 : Garbage collector now breaks reference loops with OrderedDict.
11 years ago
Benjamin Peterson
9ad11544bf
set tp_new from the class in the hierarchy that actually owns the descriptor ( closes #25731 )
Debugging by Eryk Sun.
11 years ago
doko@ubuntu.com
17210f50d2
dictobject.c(dict_sizeof): Make it static again.
11 years ago
Barry Warsaw
09880c89e9
Comment out some tests that won't pass now that we've reverted the
picklability regression. Also, as per further discussion, remove the
regressing code.
11 years ago
Barry Warsaw
885e1939be
Issue #22995 : [UPDATE] Comment out the one of the pickleability tests in
_PyObject_GetState() due to regressions observed in Cython-based projects.
11 years ago
Benjamin Peterson
0e617e22f0
remove some copyright notices supserseded by the toplevel ones
11 years ago
Serhiy Storchaka
42bf8fc901
Issue #25961 : Disallowed null characters in the type name.
Simplified testing for null characters in __name__ setter.
11 years ago
Serhiy Storchaka
191321d11b
Issue #20440 : More use of Py_SETREF.
This patch is manually crafted and contains changes that couldn't be handled
automatically.
11 years ago
Serhiy Storchaka
4a1e70fc31
Issue #20440 : Applied yet one patch for using Py_SETREF.
The patch is automatically generated, it replaces the code that uses Py_CLEAR.
11 years ago
Serhiy Storchaka
f81be8aa3f
Issue #22995 : Instances of extension types with a state that aren't
subclasses of list or dict and haven't implemented any pickle-related
methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__,
or __getstate__), can no longer be pickled. Including memoryview.
11 years ago
Serhiy Storchaka
5a57ade58e
Issue #20440 : Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
11 years ago
Serhiy Storchaka
0ce7a3a34c
Issue #25914 : Fixed and simplified OrderedDict.__sizeof__.
11 years ago
Serhiy Storchaka
5aac3ed799
Issue #25766 : Special method __bytes__() now works in str subclasses.
11 years ago
Serhiy Storchaka
5c4064e8bd
Issue #25421 : __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
11 years ago
Serhiy Storchaka
e800941d66
Issue #25709 : Fixed problem with in-place string concatenation and utf-8 cache.
11 years ago
Serhiy Storchaka
7aa690860e
Issue #25709 : Fixed problem with in-place string concatenation and utf-8 cache.
11 years ago
Serhiy Storchaka
d28bb624d1
Issue #24097 : Fixed crash in object.__reduce__() if slot name is freed inside
__getattr__. Original patch by Antoine Pitrou.
11 years ago
Serhiy Storchaka
15095800a3
Issue #24731 : Fixed crash on converting objects with special methods
__bytes__, __trunc__, and __float__ returning instances of subclasses of
bytes, int, and float to subclasses of bytes, int, and float correspondingly.
11 years ago
Benjamin Peterson
a4d33b3428
make the PyUnicode_FSConverter cleanup set the decrefed argument to NULL ( closes #25630 )
11 years ago
Serhiy Storchaka
19a70e7f5d
Issue #25462 : The hash of the key now is calculated only once in most
operations in C implementation of OrderedDict.
11 years ago
Serhiy Storchaka
d7a4415599
Issue #22995 : Default implementation of __reduce__ and __reduce_ex__ now
rejects builtin types with not defined __new__.
Added tests for non-pickleable types.
11 years ago
Stefan Krah
7c3f3859a5
Fix Visual Studio warning.
11 years ago
Stefan Krah
0ce5b6e268
Iaaue #25598 : Fix memory_hex from #9951 for non-contiguous buffers.
11 years ago
Martin Panter
eeb896c411
Issue #24802 : Copy bytes-like objects to null-terminated buffers if necessary
This avoids possible buffer overreads when int(), float(), compile(), exec()
and eval() are passed bytes-like objects. Similar code is removed from the
complex() constructor, where it was not reachable.
Patch by John Leitch, Serhiy Storchaka and Martin Panter.
11 years ago
Serhiy Storchaka
97f46db904
Issue #25410 : Made testing that od_fast_nodes and dk_entries are in sync more
reliable.
11 years ago
Serhiy Storchaka
d5f353ec8d
Issue #24726 : Revert setting the value on the dict if
_odict_add_new_node() fails.
11 years ago
Serhiy Storchaka
9c967611e3
Issue #25558 : Refactoring OrderedDict iteration.
11 years ago
Serhiy Storchaka
710cd34bdb
Issue #25449 : Fixed a crash and leaking NULL in repr() of OrderedDict that
was mutated by direct calls of dict methods.
11 years ago
Serhiy Storchaka
b45b7b2137
Issue #25449 : Iterating OrderedDict with keys with unstable hash now raises
KeyError in C implementations as well as in Python implementation.
Added tests for OrderedDict subclasses.
11 years ago
Serhiy Storchaka
d65c9496da
Issue #25523 : Further a-to-an corrections.
11 years ago
Martin Panter
7462b64911
Issue #25523 : Correct "a" article to "an" article
This changes the main documentation, doc strings, source code comments, and a
couple error messages in the test suite. In some cases the word was removed
or edited some other way to fix the grammar.
11 years ago
Serhiy Storchaka
14eefe353e
Issue #25395 : Fixed crash when highly nested OrderedDict structures were
garbage collected.
11 years ago
Serhiy Storchaka
4575beba4b
Issue #25410 : C implementation of OrderedDict now uses type(self) instead of
self.__class__ in __repr__() and __reduce__() for simplicity and reliability.
11 years ago
Serhiy Storchaka
d17427b7bd
Issue #25410 : Fixed a memory leak in OrderedDict in the case when key's hash
calculation fails.
11 years ago
Serhiy Storchaka
8003bafd7f
Issue #25410 : Cleaned up and fixed minor bugs in C implementation of OrderedDict.
11 years ago
Serhiy Storchaka
992ec46acc
Issue #25406 : Fixed a bug in C implementation of OrderedDict.move_to_end()
that caused segmentation fault or hang in iterating after moving several
items to the start of ordered dict.
11 years ago
Martin Panter
ec1aa5c2a1
More typos in 3.5 documentation and comments
11 years ago
Martin Panter
9955a373a8
Various minor typos in documentation and comments
11 years ago
Benjamin Peterson
bd6c41a185
prevent unacceptable bases from becoming bases through multiple inheritance ( #24806 )
11 years ago
Serhiy Storchaka
28b21e50c8
Issue #24848 : Fixed bugs in UTF-7 decoding of misformed data:
1. Non-ASCII bytes were accepted after shift sequence.
2. A low surrogate could be emitted in case of error in high surrogate.
11 years ago
Serhiy Storchaka
b9d98d532c
Issue #24483 : C implementation of functools.lru_cache() now calculates key's
hash only once.
11 years ago
Victor Stinner
89719e1daf
Issue #25182 : Fix compilation on Windows
Restore also errno value before calling PyErr_SetFromErrno().
11 years ago
Serhiy Storchaka
a59018c7ab
Issue #25182 : The stdprinter (used as sys.stderr before the io module is
imported at startup) now uses the backslashreplace error handler.
11 years ago
Victor Stinner
5783fd2c58
Issue #24999 : In longobject.c, use two shifts instead of ">> 2*PyLong_SHIFT" to
avoid undefined behaviour when LONG_MAX type is smaller than 60 bits.
This change should fix a warning with the ICC compiler.
11 years ago
Victor Stinner
4a0d1e7c36
odictobject.c: fix compiler warning
PyObject_Length() returns a P_ssize_t, not an int. Use a Py_ssize_t to avoid
overflow.
11 years ago
Guido van Rossum
7d293ee97d
Issue #24912 : Prevent __class__ assignment to immutable built-in objects.
11 years ago
Victor Stinner
ca30b02abe
Issue #24992 : Fix error handling and a race condition (related to garbage
collection) in collections.OrderedDict constructor.
Patch reviewed by Serhiy Storchaka.
11 years ago
Zachary Ware
79b98df023
Issue #21279 : Flesh out str.translate docs
Initial patch by Kinga Farkas, Martin Panter, and John Posner.
11 years ago
Stefan Krah
0c51595a78
Issue #15944 : memoryview: Allow arbitrary formats when casting to bytes.
Original patch by Martin Panter.
11 years ago