summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d/next/C API
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36379: __ipow__ must be a ternaryfunc, not a binaryfunc (GH-13546)Zackery Spytz2019-05-311-0/+2
| | | | | | | If a type's __ipow__ method was implemented in C, attempting to use the *modulo* parameter would cause crashes. https://bugs.python.org/issue36379
* bpo-36974: implement PEP 590 (GH-13185)Jeroen Demeyer2019-05-291-0/+2
| | | | | Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be> Co-authored-by: Mark Shannon <mark@hotpy.org>
* bpo-36922: implement PEP-590 Py_TPFLAGS_METHOD_DESCRIPTOR (GH-13338)Jeroen Demeyer2019-05-281-0/+3
| | | Co-authored-by: Mark Shannon <mark@hotpy.org>
* bpo-36763: Implement the PEP 587 (GH-13592)Victor Stinner2019-05-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a whole new documentation page: "Python Initialization Configuration" * PyWideStringList_Append() return type is now PyStatus, instead of int * PyInterpreterState_New() now calls PyConfig_Clear() if PyConfig_InitPythonConfig() fails. * Rename files: * Python/coreconfig.c => Python/initconfig.c * Include/cpython/coreconfig.h => Include/cpython/initconfig.h * Include/internal/: pycore_coreconfig.h => pycore_initconfig.h * Rename structures * _PyCoreConfig => PyConfig * _PyPreConfig => PyPreConfig * _PyInitError => PyStatus * _PyWstrList => PyWideStringList * Rename PyConfig fields: * use_module_search_paths => module_search_paths_set * module_search_path_env => pythonpath_env * Rename PyStatus field: _func => func * PyInterpreterState: rename core_config field to config * Rename macros and functions: * _PyCoreConfig_SetArgv() => PyConfig_SetBytesArgv() * _PyCoreConfig_SetWideArgv() => PyConfig_SetArgv() * _PyCoreConfig_DecodeLocale() => PyConfig_SetBytesString() * _PyInitError_Failed() => PyStatus_Exception() * _Py_INIT_ERROR_TYPE_xxx enums => _PyStatus_TYPE_xxx * _Py_UnixMain() => Py_BytesMain() * _Py_ExitInitError() => Py_ExitStatusException() * _Py_PreInitializeFromArgs() => Py_PreInitializeFromBytesArgs() * _Py_PreInitializeFromWideArgs() => Py_PreInitializeFromArgs() * _Py_PreInitialize() => Py_PreInitialize() * _Py_RunMain() => Py_RunMain() * _Py_InitializeFromConfig() => Py_InitializeFromConfig() * _Py_INIT_XXX() => _PyStatus_XXX() * _Py_INIT_FAILED() => _PyStatus_EXCEPTION() * Rename 'err' PyStatus variables to 'status' * Convert RUN_CODE() macro to config_run_code() static inline function * Remove functions: * _Py_InitializeFromArgs() * _Py_InitializeFromWideArgs() * _PyInterpreterState_GetCoreConfig()
* bpo-37017: PyObject_CallMethodObjArgs uses LOAD_METHOD optimization (GH-13516)Michael J. Sullivan2019-05-261-0/+4
| | | | | | | | | Update PyObject_CallMethodObjArgs and _PyObject_CallMethodIdObjArgs to use _PyObject_GetMethod to avoid creating a bound method object in many cases. On a microbenchmark of PyObject_CallMethodObjArgs calling a method on an interpreted Python class, this optimization resulted in a 1.7x speedup.
* bpo-36763: _Py_RunMain() doesn't call Py_Exit() anymore (GH-13390)Victor Stinner2019-05-171-0/+3
| | | | | | | | | Py_Main() and _Py_RunMain() now return the exitcode rather than calling Py_Exit(exitcode) when calling PyErr_Print() if the current exception type is SystemExit. * Add _Py_HandleSystemExit(). * Add pymain_exit_err_print(). * Add pymain_exit_print().
* bpo-36728: Remove PyEval_ReInitThreads() from C API (GH-13241)Victor Stinner2019-05-131-0/+2
| | | | | | | | Remove the PyEval_ReInitThreads() function from the Python C API. It should not be called explicitly: use PyOS_AfterFork_Child() instead. Rename PyEval_ReInitThreads() to _PyEval_ReInitThreads() and add a 'runtime' parameter.
* Python 3.8.0a4v3.8.0a4Łukasz Langa2019-05-066-24/+0
|
* bpo-36763: Fix Py_SetStandardStreamEncoding() (GH-13028)Victor Stinner2019-04-301-0/+2
| | | | Fix memory leak in Py_SetStandardStreamEncoding(): release memory if the function is called twice.
* bpo-36025: Fix PyDate_FromTimestamp API (GH-11922)Paul Ganssle2019-04-271-0/+5
| | | | | | | | | | | | | In the process of converting the date.fromtimestamp function to use argument clinic in GH-8535, the C API for PyDate_FromTimestamp was inadvertently changed to expect a timestamp object rather than an argument tuple. This PR fixes this backwards-incompatible change by adding a new wrapper function for the C API function that unwraps the argument tuple and passes it to the underlying function. This PR also adds tests for both PyDate_FromTimestamp and PyDateTime_FromTimestamp to prevent any further regressions.
* bpo-36641: Add "const" to PyDoc_VAR macro (GH-12854)Inada Naoki2019-04-161-0/+2
| | | It reduces "data" segment in python about 200KB.
* bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782)Victor Stinner2019-04-111-0/+5
| | | | | 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().
* bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589)Victor Stinner2019-03-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | bpo-36443, bpo-36202: Since Python 3.7.0, calling Py_DecodeLocale() before Py_Initialize() produces mojibake if the LC_CTYPE locale is coerced and/or if the UTF-8 Mode is enabled by the user configuration. This change fix the issue by disabling LC_CTYPE coercion and UTF-8 Mode by default. They must now be enabled explicitly (opt-in) using the new _Py_PreInitialize() API with _PyPreConfig. When embedding Python, set coerce_c_locale and utf8_mode attributes of _PyPreConfig to -1 to enable automatically these parameters depending on the LC_CTYPE locale, environment variables and command line arguments Alternative: Setting Py_UTF8Mode to 1 always explicitly enables the UTF-8 Mode. Changes: * _PyPreConfig_INIT now sets coerce_c_locale and utf8_mode to 0 by default. * _Py_InitializeFromArgs() and _Py_InitializeFromWideArgs() can now be called with config=NULL.
* bpo-35810: Incref heap-allocated types in PyObject_Init (GH-11661)Eddie Elizondo2019-03-271-0/+4
| | | | | * Incref heap-allocated types in PyObject_Init * Add documentation and porting notes to What's New
* v3.8.0a3v3.8.0a3Łukasz Langa2019-03-252-4/+0
|
* bpo-36381: warn when no PY_SSIZE_T_CLEAN defined (GH-12473)Inada Naoki2019-03-231-0/+2
| | | We will remove int support from 3.10 or 4.0.
* bpo-36142: Exclude coreconfig.h from Py_LIMITED_API (GH-12111)Victor Stinner2019-03-011-0/+2
| | | | | | | | | The whole coreconfig.h header is now excluded from Py_LIMITED_API. Move functions definitions into a new internal pycore_coreconfig.h header. * Move Include/coreconfig.h to Include/cpython/coreconfig.h * coreconfig.h header is now excluded from Py_LIMITED_API * Move functions to pycore_coreconfig.h
* [blurb] v3.8.0a1Łukasz Langa2019-02-0322-43/+0
|
* bpo-35713: Rework Python initialization (GH-11647)Victor Stinner2019-01-221-0/+3
| | | | | | | | | | | | | | | | | | | * The PyByteArray_Init() and PyByteArray_Fini() functions have been removed. They did nothing since Python 2.7.4 and Python 3.2.0, were excluded from the limited API (stable ABI), and were not documented. * Move "_PyXXX_Init()" and "_PyXXX_Fini()" declarations from Include/cpython/pylifecycle.h to Include/internal/pycore_pylifecycle.h. Replace "PyAPI_FUNC(TYPE)" with "extern TYPE". * _PyExc_Init() now returns an error on failure rather than calling Py_FatalError(). Move macros inside _PyExc_Init() and undefine them when done. Rewrite macros to make them look more like statement: add ";" when using them, add "do { ... } while (0)". * _PyUnicode_Init() now returns a _PyInitError error rather than call Py_FatalError(). * Move stdin check from _PySys_BeginInit() to init_sys_streams(). * _Py_ReadyTypes() now returns a _PyInitError error rather than calling Py_FatalError().
* bpo-33817: Fix _PyBytes_Resize() for empty bytes object. (GH-11516)Serhiy Storchaka2019-01-121-0/+1
| | | | Add also tests for PyUnicode_FromFormat() and PyBytes_FromFormat() with empty result.
* bpo-34193: Fix pluralization in getargs.c and test cases. (GH-8438)Xtreak2018-12-211-0/+2
|
* bpo-35259: Limit `Py_FinalizeEx()` to `Py_LIMITED_API >= 0x03060000`. (GH-10620)Arthur Neufeld2018-12-201-0/+2
|
* bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759)Victor Stinner2018-11-281-0/+2
| | | | | | | | | Fix memory leak in PyUnicode_EncodeLocale() and PyUnicode_EncodeFSDefault() on error handling. Changes: * Fix unicode_encode_locale() error handling * Fix test_codecs.LocaleCodecTest
* bpo-35134: Create Include/cpython/ subdirectory (GH-10624)Victor Stinner2018-11-231-0/+1
| | | | | | | | | | | | | | | | Include/*.h should be the "portable Python API", whereas Include/cpython/*.h should be the "CPython API": CPython implementation details. Changes: * Create Include/cpython/ subdirectory * "make install" now creates $prefix/include/cpython and copy Include/cpython/* to $prefix/include/cpython * Create Include/cpython/objimpl.h: move objimpl.h code surrounded by "#ifndef Py_LIMITED_API" to cpython/objimpl.h. * objimpl.h now includes cpython/objimpl.h * Windows installer (MSI) now also install Include/ subdirectories: Include/cpython/ and Include/internal/.
* bpo-35296: make install now installs the internal API (GH-10665)Victor Stinner2018-11-231-0/+2
| | | | make install now also installs the internal API: Include/internal/*.h header files.
* bpo-35081: add NEWS entry for new Include/internal/pycore_*.h files (GH-10666)Victor Stinner2018-11-231-0/+2
|
* bpo-35059: NEWS entry for macros converted to inline funcs (GH-10671)Victor Stinner2018-11-231-0/+3
|
* bpo-34725: Adds _Py_SetProgramFullPath so embedders may override ↵Steve Dower2018-11-181-0/+1
| | | | sys.executable (GH-9860)
* bpo-35081: Make some _PyGC macros internal (GH-10507)Victor Stinner2018-11-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * Move "GC" macros together: * PyObject_IS_GC() * _Py_AS_GC() * _PyObject_GC_IS_TRACKED() * _PyObject_GC_MAY_BE_TRACKED() * Mark other GC macros as internal (#ifdef Py_BUILD_CORE): * _PyGCHead_NEXT(g), _PyGCHead_SET_NEXT(g, p) * _PyGCHead_PREV(g), _PyGCHead_SET_PREV(g, p) * _PyGCHead_FINALIZED(g), _PyGCHead_SET_FINALIZED(g) * _PyGC_FINALIZED(o), _PyGC_SET_FINALIZED(o) * _PyObject_GC_TRACK(o), _PyObject_GC_UNTRACK(o) * _PyGC_PREV_MASK_FINALIZED * _PyGC_PREV_MASK_COLLECTING * _PyGC_PREV_SHIFT * _PyGC_PREV_MASK * Replace _PyGC_generation0 with _PyRuntime.gc.generation0 * _queuemodule.c: replace _PyObject_GC_UNTRACK() with with PyObject_GC_UnTrack() * Document that _PyObject_GC_TRACK() _PyObject_GC_UNTRACK() macros have been removed from the public C API.
* bpo-30863: Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). ↵Serhiy Storchaka2018-10-231-0/+2
| | | | | | (GH-2599) They no longer cache the wchar_t* representation of string objects.
* bpo-34910: Ensure that PyObject_Print() always returns -1 on error. (GH-9733)Zackery Spytz2018-10-061-0/+2
|
* Revert "bpo-34589: Add -X coerce_c_locale command line option (GH-9378)" ↵Victor Stinner2018-09-191-3/+0
| | | | | | | | | | | | | | | | (GH-9430) * Revert "bpo-34589: Add -X coerce_c_locale command line option (GH-9378)" This reverts commit dbdee0073cf0b88fe541980ace1f650900f455cc. * Revert "bpo-34589: C locale coercion off by default (GH-9073)" This reverts commit 7a0791b6992d420dc52536257f2f093851ed7215. * Revert "bpo-34589: Make _PyCoreConfig.coerce_c_locale private (GH-9371)" This reverts commit 188ebfa475a6f6aa2d0ea14ca8e1fbe7865b6d27.
* bpo-32455: Add jump parameter to dis.stack_effect(). (GH-6610)Serhiy Storchaka2018-09-181-0/+1
| | | | Add C API function PyCompile_OpcodeStackEffectWithJump().
* bpo-34589: C locale coercion off by default (GH-9073)Victor Stinner2018-09-171-0/+3
| | | | | | | | | Py_Initialize() and Py_Main() cannot enable the C locale coercion (PEP 538) anymore: it is always disabled. It can now only be enabled by the Python program ("python3). test_embed: get_filesystem_encoding() doesn't have to set PYTHONUTF8 nor PYTHONCOERCECLOCALE, these variables are already set in the parent.
* Revert "bpo-34595: Add %T format to PyUnicode_FromFormatV() (GH-9080)" (GH-9187)Victor Stinner2018-09-111-4/+0
| | | This reverts commit 886483e2b9bbabf60ab769683269b873381dd5ee.
* bpo-34595: Add %T format to PyUnicode_FromFormatV() (GH-9080)Victor Stinner2018-09-071-0/+4
| | | | | | | | | * Add %T format to PyUnicode_FromFormatV(), and so to PyUnicode_FromFormat() and PyErr_Format(), to format an object type name: equivalent to "%s" with Py_TYPE(obj)->tp_name. * Replace Py_TYPE(obj)->tp_name with %T format in unicodeobject.c. * Add unit test on %T format. * Rename unicode_fromformat_write_cstr() to unicode_fromformat_write_utf8(), to make the intent more explicit.
* bpo-34523: Py_DecodeLocale() use UTF-8 on Windows (GH-8998)Victor Stinner2018-08-291-0/+2
| | | | | | | Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding on Windows if Py_LegacyWindowsFSEncodingFlag is zero. pymain_read_conf() now sets Py_LegacyWindowsFSEncodingFlag in its loop, but restore its value at exit.
* bpo-32500: Fix error messages for sequence and mapping C API. (GH-7846)Serhiy Storchaka2018-07-231-0/+4
| | | | | 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-34127: Fix grammar in error message with respect to argument count (GH-8395)Xtreak2018-07-221-0/+2
|
* bpo-34008: Allow to call Py_Main() after Py_Initialize() (GH-8043)Victor Stinner2018-07-201-0/+1
| | | | | Py_Main() can again be called after Py_Initialize(), as in Python 3.6. The new configuration is ignored, except of _PyMainInterpreterConfig.argv which is used to update sys.argv.
* bpo-23927: Make getargs.c skipitem() skipping 'w*'. (GH-8192)Serhiy Storchaka2018-07-111-0/+2
|
* Forward port 3.7.0 final changesNed Deily2018-06-271-2/+0
|
* bpo-33932: Calling Py_Initialize() twice does nothing (GH-7845)Victor Stinner2018-06-221-0/+2
| | | | Calling Py_Initialize() twice does nothing, instead of failing with a fatal error: restore the Python 3.6 behaviour.
* bpo-33818: PyExceptionClass_Name() will now return "const char *". (GH-7581)Serhiy Storchaka2018-06-151-0/+2
|
* bpo-33042: Fix pre-initialization sys module configuration (GH-6157)Nick Coghlan2018-03-251-0/+2
| | | | | | | | | - new test case for pre-initialization of sys.warnoptions and sys._xoptions - restored ability to call these APIs prior to Py_Initialize - updated the docs for the affected APIs to make it clear they can be called before Py_Initialize - also enhanced the existing embedding test cases to check for expected settings in the sys module
* bpo-32374: m_traverse may be called with m_state=NULL (GH-5140)Marcel Plch2018-03-171-0/+2
| | | | | 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.
* Update NEWS, docs, and patchlevel for 3.7.0b1Ned Deily2018-01-312-4/+0
|
* bpo-32681: Fix an uninitialized variable in the C implementation of os.dup2 ↵Stéphane Wirtel2018-01-301-0/+2
| | | | | (GH-5346) See https://bugs.python.org/issue32441 for where this was introduced.
* bpo-10381: Add timezone to datetime C API (#5032)Paul Ganssle2018-01-241-0/+2
| | | | | | | | | | | | | | | | | | * Add timezone to datetime C API * Add documentation for timezone C API macros * Add dedicated tests for datetime type check macros * Remove superfluous C API test * Drop support for TimeZoneType in datetime C API * Expose UTC singleton to the datetime C API * Update datetime C-API documentation to include links * Add reference count information for timezone constructors
* Update docs for 3.7.0a4Ned Deily2018-01-094-7/+0
|