| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Add new trashcan macros to deal with a double deallocation that could occur when the `tp_dealloc` of a subclass calls the `tp_dealloc` of a base class and that base class uses the trashcan mechanism.
Patch by Jeroen Demeyer.
|
| |
|
|
|
|
| |
If the PyObject_MALLOC() call failed in PyType_FromSpecWithBases(),
PyObject_Free() would be called on a static string in type_dealloc().
|
|
|
| |
Adds ㋿.
|
|
|
|
| |
Classes that define __str__ the same as __repr__ can
just inherit it from object.
|
| |
|
|
|
| |
In addition, fix some other minor violations of C99.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
_PyCoreConfig: Change filesystem_encoding, filesystem_errors,
stdio_encoding and stdio_errors fields type from char* to wchar_t*.
Changes:
* PyInterpreterState: replace fscodec_initialized (int) with fs_codec
structure.
* Add get_error_handler_wide() and unicode_encode_utf8() helper
functions.
* Add error_handler parameter to unicode_encode_locale()
and unicode_decode_locale().
* Remove _PyCoreConfig_SetString().
* Rename _PyCoreConfig_SetWideString() to _PyCoreConfig_SetString().
* Rename _PyCoreConfig_SetWideStringFromString()
to _PyCoreConfig_DecodeLocale().
|
|
|
|
|
|
| |
Move get_codec_name() and initfsencoding() from pylifecycle.c to
unicodeobject.c.
Rename also "init" functions in pylifecycle.c.
|
|
|
|
|
|
|
| |
Add _Py_FORCE_UTF8_LOCALE and _Py_FORCE_UTF8_FS_ENCODING macros to
avoid factorize "#if defined(__ANDROID__) || defined(__VXWORKS__)"
and "#if defined(__APPLE__)".
Cleanup also config_init_fs_encoding().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit contains the implementation of PEP570: Python positional-only parameters.
* Update Grammar/Grammar with new typedarglist and varargslist
* Regenerate grammar files
* Update and regenerate AST related files
* Update code object
* Update marshal.c
* Update compiler and symtable
* Regenerate importlib files
* Update callable objects
* Implement positional-only args logic in ceval.c
* Regenerate frozen data
* Update standard library to account for positional-only args
* Add test file for positional-only args
* Update other test files to account for positional-only args
* Add News entry
* Update inspect module and related tests
|
|
|
| |
https://bugs.python.org/issue36745
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Omit serialno field from debug hooks on Python memory allocators to
reduce the memory footprint by 5%.
Enable tracemalloc to get the traceback where a memory block has been
allocated when a fatal memory error is logged to decide where to put
a breakpoint.
Compile Python with PYMEM_DEBUG_SERIALNO defined to get back the
field.
|
|
|
|
|
|
| |
Add a new _PyObject_CheckConsistency() function which can be used to
help debugging. The function is available in release mode.
Add a 'check_content' parameter to _PyDict_CheckConsistency().
|
|
|
|
| |
uppercasing it (GH-12804)
|
| |
|
|
|
|
|
| |
Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD,
0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte
patterns than Windows CRT debug malloc() and free().
|
|
|
|
|
|
|
|
|
| |
Replace _PyMem_IsFreed() function with _PyMem_IsPtrFreed() inline
function. The function is now way more efficient, it became a simple
comparison on integers, rather than a short loop. It detects also
uninitialized bytes and "forbidden bytes" filled by debug hooks
on memory allocators.
Add unit tests on _PyObject_IsFreed().
|
|
|
| |
Use fewer iterations instead of iterating over the whole entry table.
|
|
|
|
| |
(GH-12619)
|
| |
|
|
|
|
| |
set.add(0) and set.add.__get__(0) now raise TypeError
with same error message.
|
|
|
|
| |
The bug occurred when the encoded surrogate character is passed
to the incremental decoder in two chunks.
|
| |
|
|
|
|
|
| |
* Incref heap-allocated types in PyObject_Init
* Add documentation and porting notes to What's New
|
|
|
| |
https://bugs.python.org/issue36433
|
| |
|
| |
|
|
|
|
|
| |
If the first PyUnicode_DecodeUTF8() call fails in structseq_repr(),
_PyUnicodeWriter_Dealloc() will be called on an uninitialized
_PyUnicodeWriter.
|
| |
|
|
|
|
|
| |
No longer limit repr(structseq) to 512 bytes. Use _PyUnicodeWriter
for better performance and to write directly Unicode rather than
encoding repr() value to UTF-8 and then decoding from UTF-8.
|
|
|
|
|
|
|
|
|
|
|
| |
When Python is compiled with Valgrind support, release Unicode
interned strings at exit in _PyUnicode_Fini().
* Rename _Py_ReleaseInternedUnicodeStrings() to
unicode_release_interned() and make it private.
* unicode_release_interned() is now called from _PyUnicode_Fini():
it must be called with a running Python thread state for TRASHCAN,
it cannot be called from pymain_free().
* Don't display statistics on interned strings at exit anymore
|
|
|
|
|
|
|
|
| |
Python initialization now fails if decoding pybuilddir.txt
configuration file fails at startup.
_PyPathConfig_Calculate() now reports memory allocation failure and
decoding error on decoding pybuilddir.txt content from
UTF-8/surrogateescape.
|
| |
|
| |
|
| |
|
|
|
|
| |
necessary). (gh-12359)
|
|
|
|
| |
(GH-12058)
|
| |
|
|
|
|
| |
Sizeof new empty dict becomes 72 bytes from 240 bytes (amd64).
It is same size to empty dict created by dict.clear().
|
|
|
|
| |
(GH-12252)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* _PyPreConfig_Write() now reallocates the pre-configuration with the
new memory allocator.
* It is no longer needed to force the "default raw memory allocator"
to clear pre-configuration and core configuration. Simplify the
code.
* _PyPreConfig_Write() now does nothing if called after
Py_Initialize(): no longer check if the allocator is the same.
* Remove _PyMem_GetDebugAllocatorsName(): dev mode sets again
allocator to "debug".
|
|
|
|
|
| |
The development mode now uses the effective name of the debug memory
allocator ("pymalloc_debug" or "malloc_debug"). So the name doesn't
change after setting the memory allocator.
|
|
|
|
|
|
| |
_collectionsmodule.c (GH-12179)
Cast function pointers to (void(*)(void)) before casting to (PyCFunction)
to make "warning: cast between incompatible function types" false alarm quiet.
|
|
|
|
|
|
|
|
|
|
| |
Methods are always bound, and `__self__` can no longer be `NULL`
(`method_new()` and `PyMethod_New()` both explicitly check for this).
Moreover, once a bound method is bound, it *stays* bound and won't be re-bound
to something else, so the section in the datamodel that talks about accessing
an methods in a different descriptor-binding context doesn't apply any more in
Python 3.
|