summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* closes bpo-34504: Remove the useless NULL check in PySequence_Check(). (GH-8935)Alexey Izbyshev2018-08-251-1/+1
| | | Reported by Svace static analyzer.
* closes bpo-34501: PyType_FromSpecWithBases: Check spec->name before ↵Alexey Izbyshev2018-08-251-4/+9
| | | | | dereferencing it. (GH-8930) Reported by Svace static analyzer.
* closes bpo-34493: Objects/genobject.c: Add missing NULL check to ↵Alexey Izbyshev2018-08-251-0/+3
| | | | compute_cr_origin() (GH-8911)
* closes bpo-34468: Objects/rangeobject.c: Fix an always-false condition in ↵Alexey Izbyshev2018-08-241-4/+4
| | | | | | | | range_repr() (GH-8880) Also, propagate the error from PyNumber_AsSsize_t() because we don't care only about OverflowError which is not reported if the second argument is NULL. Reported by Svace static analyzer.
* closes bpo-34477: Objects/typeobject.c: Add missing NULL check to ↵Alexey Izbyshev2018-08-241-0/+3
| | | | | type_init() (GH-8876) Reported by Svace static analyzer.
* bpo-34436: Fix check that disables overallocation for the last fmt specifier ↵Alexey Izbyshev2018-08-231-3/+3
| | | | | (GH-8826) Reported by Svace static analyzer.
* bpo-34435: Add missing NULL check to unicode_encode_ucs1(). (GH-8823)Alexey Izbyshev2018-08-191-2/+3
| | | Reported by Svace static analyzer.
* bpo-22602: Raise an exception in the UTF-7 decoder for ill-formed sequences ↵Zackery Spytz2018-08-191-0/+5
| | | | | | | starting with "+". (GH-8741) The UTF-7 decoder now raises UnicodeDecodeError for ill-formed sequences starting with "+" (as specified in RFC 2152).
* bpo-34151: Improve performance of some list operations (GH-8332)Sergey Fedoseev2018-08-111-15/+36
|
* bpo-34301: Add _PyInterpreterState_Get() helper function (GH-8592)Victor Stinner2018-08-036-10/+10
| | | | sys_setcheckinterval() now uses a local variable to parse arguments, before writing into interp->check_interval.
* bpo-1617161: Make the hash and equality of methods not depending on the ↵Serhiy Storchaka2018-07-313-37/+20
| | | | | | | | | | | value of self. (GH-7848) * The hash of BuiltinMethodType instances no longer depends on the hash of __self__. It depends now on the hash of id(__self__). * The hash and equality of ModuleType and MethodWrapperType instances no longer depend on the hash and equality of __self__. They depend now on the hash and equality of id(__self__). * MethodWrapperType instances no longer support ordering.
* bpo-20260: Implement non-bitwise unsigned int converters for Argument ↵Serhiy Storchaka2018-07-261-0/+96
| | | | Clinic. (GH-8434)
* bpo-34170: Add _PyCoreConfig.bytes_warning (GH-8447)Victor Stinner2018-07-242-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add more fields to _PyCoreConfig: * _check_hash_pycs_mode * bytes_warning * debug * inspect * interactive * legacy_windows_fs_encoding * legacy_windows_stdio * optimization_level * quiet * unbuffered_stdio * user_site_directory * verbose * write_bytecode Changes: * Remove pymain_get_global_config() and pymain_set_global_config() which became useless. These functions have been replaced by _PyCoreConfig_GetGlobalConfig() and _PyCoreConfig_SetGlobalConfig(). * sys.flags.dont_write_bytecode value is now restricted to 1 even if -B option is specified multiple times on the command line. * PyThreadState_Clear() now uses the config from the current interpreter rather than using global Py_VerboseFlag
* bpo-33720: Refactor marshalling/unmarshalling floats. (GH-8071)Serhiy Storchaka2018-07-241-1/+1
|
* bpo-32500: Fix error messages for sequence and mapping C API. (GH-7846)Serhiy Storchaka2018-07-231-0/+20
| | | | | Fix error messages for PySequence_Size(), PySequence_GetItem(), PySequence_SetItem() and PySequence_DelItem() called with a mapping and PyMapping_Size() called with a sequence.
* bpo-24618: Add a check in the code constructor. (GH-8283)Serhiy Storchaka2018-07-161-3/+15
| | | Check that the size of the varnames tuple is enough at least for all arguments.
* bpo-34087: Fix buffer overflow in int(s) and similar functions (GH-8274)INADA Naoki2018-07-141-0/+2
| | | | | | `_PyUnicode_TransformDecimalAndSpaceToASCII()` missed trailing NUL char. It caused buffer overflow in `_Py_string_to_number_with_underscores()`. This bug is introduced in 9b6c60cb.
* bpo-33597: Reduce PyGC_Head size (GH-7043)INADA Naoki2018-07-101-6/+7
|
* bpo-34042: Fix dict.copy() to maintain correct total refcount (GH-8119)Yury Selivanov2018-07-061-0/+7
|
* fix two typos in Objects/odictobject.c comments (GH-8040)Robert Krzyzanowski2018-07-061-2/+2
|
* bpo-20180: complete AC conversion of Objects/stringlib/transmogrify.h (GH-8039)Tal Einat2018-07-065-76/+243
| | | | * converted bytes methods: expandtabs, ljust, rjust, center, zfill * updated char_convertor to properly set the C default value
* bpo-33418: Add tp_clear for function object (GH-8058)INADA Naoki2018-07-041-13/+21
| | | | | Without tp_clear, GC can't break cyclic reference. It will cause memory leak when cyclic reference is created intentionally.
* Change tp_size to tp_basicsize in comment and realign the comments (GH-6775)Bup2018-06-191-38/+38
|
* bpo-33818: PyExceptionClass_Name() will now return "const char *". (GH-7581)Serhiy Storchaka2018-06-151-2/+2
|
* Clean up after bpo-33738. (GH-7627)Serhiy Storchaka2018-06-111-1/+1
| | | | | * Add declarations even if they are overridden by macros. * Make the declaration and the definition of PyExceptionClass_Name consistent.
* bpo-33738: Address review comments in GH #7477 (GH-7585)Christian Tismer2018-06-102-0/+3
|
* bpo-33738: Fix macros which contradict PEP 384 (GH-7477)Christian Tismer2018-06-092-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During development of the limited API support for PySide, we saw an error in a macro that accessed a type field. This patch fixes the 7 errors in the Python headers. Macros which were not written as capitals were implemented as function. To do the necessary analysis again, a script was included that parses all headers and looks for "->tp_" in serctions which can be reached with active limited API. It is easily possible to call this script as a test. Error listing: ../../Include/objimpl.h:243 #define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \ (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o))) Action: commented only ../../Include/objimpl.h:362 #define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0) Action: commented only ../../Include/objimpl.h:364 #define PyObject_GET_WEAKREFS_LISTPTR(o) \ ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset)) Action: commented only ../../Include/pyerrors.h:143 #define PyExceptionClass_Name(x) \ ((char *)(((PyTypeObject*)(x))->tp_name)) Action: implemented function ../../Include/abstract.h:593 #define PyIter_Check(obj) \ ((obj)->ob_type->tp_iternext != NULL && \ (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) Action: implemented function ../../Include/abstract.h:713 #define PyIndex_Check(obj) \ ((obj)->ob_type->tp_as_number != NULL && \ (obj)->ob_type->tp_as_number->nb_index != NULL) Action: implemented function ../../Include/abstract.h:924 #define PySequence_ITEM(o, i)\ ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) ) Action: commented only
* bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() ↵Yury Selivanov2018-06-081-8/+7
| | | | (GH-7467)
* update to Unicode 11.0.0 (closes bpo-33778) (GH-7439)Benjamin Peterson2018-06-071-724/+946
| | | Also, standardize indentation of generated tables.
* Replace _PyGC_REFS macros with higher level macros (GH-6852)INADA Naoki2018-05-171-5/+3
| | | | Only gcmodule.c uses _PyGC_REFS* macros now. This makes easy to read GC code.
* Fix typo in __mul__ and __rmul__ docstring (GH-6674)Grant Jenks2018-05-081-2/+2
|
* bpo-33391: Fix refleak in set_symmetric_difference (GH-6670)lekma2018-05-021-1/+3
|
* bpo-33012: Fix invalid function casts for long_long. (GH-6652)Serhiy Storchaka2018-04-301-17/+25
| | | | | long_long() was used with three function types: PyCFunction, getter and unaryfunction.
* bpo-33330: Write exceptions occurred in PyImport_Cleanup() to stderr. (GH-6606)Serhiy Storchaka2018-04-291-4/+6
| | | | They where silenced before.
* bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. ↵Siddhesh Poyarekar2018-04-2925-164/+164
| | | | | | | | | (GH-6030) METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument.
* bpo-33041: Fix downcast warning on Windows (#6595)Victor Stinner2018-04-271-1/+1
| | | | Cast pointer difference from ssize_t to int: a frame is very unlikely larger than 2 GB.
* Spelling fixes to docs, docstrings, and comments (GH-6374)Ville Skyttä2018-04-201-1/+1
|
* bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537)Gregory P. Smith2018-04-202-24/+14
| | | | | | | | | | | | | | | | | | | | Fix clang ubsan (undefined behavior sanitizer) warnings in dictobject.c by adjusting how the internal struct _dictkeysobject shared keys structure is declared. This remains ABI compatible. We get rid of the union at the end of the struct being used for conveinence to avoid typecasting in favor of char[] variable length array at the end of a struct. This is known to clang to be used for variable sized objects and will not cause an undefined behavior problem. Similarly, char arrays do not have strict aliasing undefined behavior when cast. PEP-007 does not currently list variable length arrays (VLAs) as allowed in our subset of C99. If this turns out to be a problem, the fix to this is to change the char `dk_indices[]` into `dk_indices[1]` and restore the three size computation subtractions this change removes: `- Py_MEMBER_SIZE(PyDictKeysObject, dk_indices)` If this works as is I'll make a separate PR to update PEP-007.
* bpo-33299: Return an object itself for some types in _PyCode_ConstantKey(). ↵Serhiy Storchaka2018-04-191-4/+11
| | | | (GH-6513)
* bpo-33205: dict: Change GROWTH_RATE to `used*3` (GH-6350)INADA Naoki2018-04-171-6/+5
|
* bpo-33176: Add a toreadonly() method to memoryviews. (GH-6466)Antoine Pitrou2018-04-141-0/+19
|
* bpo-33031: Remove dead code in C implementation of OrderedDict. (GH-6120)Serhiy Storchaka2018-04-091-76/+1
| | | | This code doesn't have effect on the final result, but causes GCC 8 warnings and can have an undefined behavior.
* bpo-33199: Initialize ma_version_tag in PyDict_Copy (GH-6341)INADA Naoki2018-04-031-0/+1
|
* Fix typo and edit for clarity in the docstrings of sys.float_info. (GH-2251)Stefano Taschini2018-03-261-3/+2
|
* bpo-30953: Improve error messages and add tests for jumping (GH-6196)Serhiy Storchaka2018-03-231-2/+6
| | | | into/out of an except block.
* bpo-33041: Rework compiling an "async for" loop. (#6142)Serhiy Storchaka2018-03-231-12/+9
| | | | | | | | * Added new opcode END_ASYNC_FOR. * Setting global StopAsyncIteration no longer breaks "async for" loops. * Jumping into an "async for" loop is now disabled. * Jumping out of an "async for" loop no longer corrupts the stack. * Simplify the compiler.
* bpo-32374: m_traverse may be called with m_state=NULL (GH-5140)Marcel Plch2018-03-171-0/+21
| | | | | Multi-phase initialized modules allow m_traverse to be called while the module is still being initialized, so module authors may need to account for that.
* bpo-17288: Prevent jumps from 'return' and 'exception' trace events. (GH-6107)xdegaye2018-03-131-4/+35
| | | (cherry picked from commit e32bbaf376a09c149fa7c7f2919d7c9ce4e2a055)
* bpo-33026: Fix jumping out of "with" block by setting f_lineno. (#6026)Serhiy Storchaka2018-03-111-9/+15
|
* closes bpo-32980 Remove _PyFrame_Init (GH-5965)Thomas Nyberg2018-03-041-8/+0
|