Skip to content

Commits on Jul 13, 2022

  1. gh-90815: Fix test_embed for Windows PGO build with mimalloc (GH-94790)

    Fixes the failure of PGO building with `mimalloc` on Windows, ensuring that `test_bpo20891` does not break profiling data (`python31*.pgc`).
    (cherry picked from commit 4a6bb30)
    
    Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
    miss-islington and neonene committed Jul 13, 2022

Commits on Sep 20, 2021

  1. bpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-2…

    …8466)
    
    Calling Py_InitializeFromConfig()+Py_RunMain() multiple times must
    not crash.
    
    Cleanup also test_get_argc_argv().
    (cherry picked from commit 5e2c32e)
    
    Co-authored-by: Victor Stinner <vstinner@python.org>
    miss-islington and vstinner committed Sep 20, 2021

Commits on Jun 23, 2021

  1. bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) (GH-2…

    …6877)
    
    Py_RunMain() now resets PyImport_Inittab to its initial value at
    exit. It must be possible to call PyImport_AppendInittab() or
    PyImport_ExtendInittab() at each Python initialization.
    
    (cherry picked from commit 489699c)
    vstinner committed Jun 23, 2021

Commits on Mar 10, 2021

  1. bpo-43445: Add frozen modules to sys.stdlib_module_names (GH-24798)

    Add frozen modules to sys.stdlib_module_names. For example, add
    "_frozen_importlib" and "_frozen_importlib_external" names.
    
    Add "list_frozen" command to Programs/_testembed.
    vstinner committed Mar 10, 2021

Commits on Jan 12, 2021

  1. bpo-42882: Add test_embed.test_unicode_id_init() (GH-24198)

    Test that _PyUnicode_FromId() works when Python is initialized
    multiples times.
    vstinner committed Jan 12, 2021

Commits on Nov 10, 2020

  1. bpo-42260: Compute the path config in the main init (GH-23211)

    The path configuration is now computed in the "main" initialization.
    The core initialization no longer computes it.
    
    * Add _PyConfig_Read() function to read the configuration without
      computing the path configuration.
    * pyinit_core() no longer computes the path configuration: it is now
      computed by init_interp_main().
    * The path configuration output members of PyConfig are now optional:
    
      * executable
      * base_executable
      * prefix
      * base_prefix
      * exec_prefix
      * base_exec_prefix
    
    * _PySys_UpdateConfig() now skips NULL strings in PyConfig.
    * _testembed: Rename test_set_config() to test_init_set_config() for
      consistency with other tests.
    vstinner committed Nov 10, 2020

Commits on Nov 4, 2020

  1. bpo-42260: Add _PyInterpreterState_SetConfig() (GH-23158)

    * Inline _PyInterpreterState_SetConfig(): replace it with
      _PyConfig_Copy().
    * Add _PyErr_SetFromPyStatus()
    * Add _PyInterpreterState_GetConfigCopy()
    * Add a new _PyInterpreterState_SetConfig() function.
    * Add an unit which gets, modifies, and sets the config.
    vstinner committed Nov 4, 2020

Commits on Jun 11, 2020

  1. bpo-40939: Remove the old parser (GH-20768)

    This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
    pablogsal committed Jun 11, 2020

Commits on Jun 8, 2020

  1. bpo-40910: Export Py_GetArgcArgv() function (GH-20721)

    Export explicitly the Py_GetArgcArgv() function to the C API and
    document the function. Previously, it was exported implicitly which
    no longer works since Python is built with -fvisibility=hidden.
    
    * Add PyConfig._orig_argv member.
    * Py_InitializeFromConfig() no longer calls _PyConfig_Write() twice.
    * PyConfig_Read() no longer initializes Py_GetArgcArgv(): it is now
      _PyConfig_Write() responsibility.
    * _PyConfig_Write() result type becomes PyStatus instead of void.
    * Write an unit test on Py_GetArgcArgv().
    vstinner committed Jun 8, 2020

Commits on May 1, 2020

  1. bpo-40453: Add PyConfig._isolated_subinterpreter (GH-19820)

    An isolated subinterpreter cannot spawn threads, spawn a child
    process or call os.fork().
    
    * Add private _Py_NewInterpreter(isolated_subinterpreter) function.
    * Add isolated=True keyword-only parameter to
      _xxsubinterpreters.create().
    * Allow again os.fork() in "non-isolated" subinterpreters.
    vstinner committed May 1, 2020

Commits on Apr 23, 2020

  1. bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)

    * Rename PyConfig.use_peg to _use_peg_parser
    * Document PyConfig._use_peg_parser and mark it a deprecated
    * Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated
      in the documentation.
    * Add use_old_parser() and skip_if_new_parser() to test.support
    * Remove sys.flags.use_peg: use_old_parser() uses
      _testinternalcapi.get_configs() instead.
    * Enhance test_embed tests
    * subprocess._args_from_interpreter_flags() copies -X oldparser
    vstinner committed Apr 23, 2020

Commits on Apr 22, 2020

  1. bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)

    Co-authored-by: Guido van Rossum <guido@python.org>
    Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
    3 people committed Apr 22, 2020

Commits on Apr 15, 2020

  1. bpo-40268: Remove unused imports in pylifecycle.c (GH-19533)

    Remove unused imports in files:
    
    * initconfig.c
    * main.c
    * preconfig.h
    * pylifecycle.c
    * python.c
    * pythonrun.c
    vstinner committed Apr 15, 2020
  2. bpo-40268: Remove explicit pythread.h includes (#19529)

    Remove explicit pythread.h includes: it is always included
    by Python.h.
    vstinner committed Apr 15, 2020

Commits on Mar 9, 2020

  1. bpo-39877: Remove useless PyEval_InitThreads() calls (GH-18883)

    Py_Initialize() calls PyEval_InitThreads() since Python 3.7. It's no
    longer needed to call it explicitly.
    vstinner committed Mar 9, 2020

Commits on Feb 3, 2020

  1. bpo-39489: Remove COUNT_ALLOCS special build (GH-18259)

    Remove:
    
    * COUNT_ALLOCS macro
    * sys.getcounts() function
    * SHOW_ALLOC_COUNT code in listobject.c
    * SHOW_TRACK_COUNT code in tupleobject.c
    * PyConfig.show_alloc_count field
    * -X showalloccount command line option
    * @test.support.requires_type_collecting decorator
    vstinner committed Feb 3, 2020

Commits on Oct 1, 2019

  1. bpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509)

    PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no
    longer return PyStatus: they cannot fail anymore.
    vstinner committed Oct 1, 2019
  2. bpo-38304: Remove PyConfig.struct_size (GH-16500) (GH-16508)

    For now, we'll rely on the fact that the config structures aren't covered by the stable ABI.
    
    We may revisit this in the future if we further explore the idea of offering a stable embedding API.
    
    (cherry picked from commit bdace21)
    vstinner committed Oct 1, 2019

Commits on Sep 29, 2019

  1. bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)

    Fix warnings options priority: PyConfig.warnoptions has the highest
    priority, as stated in the PEP 587.
    
    * Document options order in PyConfig.warnoptions documentation.
    * Make PyWideStringList_INIT macro private: replace "Py" prefix
      with "_Py".
    * test_embed: add test_init_warnoptions().
    vstinner committed Sep 29, 2019

Commits on Sep 28, 2019

  1. bpo-38304: Add PyConfig.struct_size (GH-16451)

    Add a new struct_size field to PyPreConfig and PyConfig structures to
    allow to modify these structures in the future without breaking the
    backward compatibility.
    
    * Replace private _config_version field with public struct_size field
      in PyPreConfig and PyConfig.
    * Public PyPreConfig_InitIsolatedConfig() and
      PyPreConfig_InitPythonConfig()
      return type becomes PyStatus, instead of void.
    * Internal _PyConfig_InitCompatConfig(),
      _PyPreConfig_InitCompatConfig(), _PyPreConfig_InitFromConfig(),
      _PyPreConfig_InitFromPreConfig() return type becomes PyStatus,
      instead of void.
    * Remove _Py_CONFIG_VERSION
    * Update the Initialization Configuration documentation.
    vstinner committed Sep 28, 2019

Commits on Sep 26, 2019

  1. bpo-38234: Fix test_embed.test_init_setpath_config() on FreeBSD (GH-1…

    …6406)
    
    Explicitly preinitializes with a Python preconfiguration to avoid
    Py_SetPath() implicit preinitialization with a compat
    preconfiguration.
    
    Fix also test_init_setpath() and test_init_setpythonhome() on macOS:
    use self.test_exe as the executable (and base_executable), rather
    than shutil.which('python3').
    vstinner committed Sep 26, 2019
  2. bpo-38234: Add test_init_setpath_config() to test_embed (GH-16402)

    * Add test_embed.test_init_setpath_config(): test Py_SetPath()
      with PyConfig.
    * test_init_setpath() and test_init_setpythonhome() no longer call
      Py_SetProgramName(), but use the default program name.
    * _PyPathConfig: isolated, site_import  and base_executable
      fields are now only available on Windows.
    * If executable is set explicitly in the configuration, ignore
      calculated base_executable: _PyConfig_InitPathConfig() copies
      executable to base_executable.
    * Complete path config documentation.
    vstinner committed Sep 26, 2019

Commits on Aug 23, 2019

  1. bpo-36763: PyConfig_Read() handles PySys_AddXOption() (GH-15431)

    PyConfig_Read() is now responsible to handle early calls to
    PySys_AddXOption() and PySys_AddWarnOption().
    
    Options added by PySys_AddXOption() are now handled the same way than
    PyConfig.xoptions and command line -X options.
    
    For example, PySys_AddXOption(L"faulthandler") enables faulthandler
    as expected.
    vstinner committed Aug 23, 2019

Commits on Jul 1, 2019

  1. bpo-36763: Use PyConfig_Clear() (GH-14445)

    Stop using "static PyConfig", PyConfig must now always use
    dynamically allocated strings: use PyConfig_SetString(),
    PyConfig_SetArgv() and PyConfig_Clear().
    vstinner committed Jul 1, 2019

Commits on May 27, 2019

  1. bpo-36763: Implement the PEP 587 (GH-13592)

    * 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()
    vstinner committed May 27, 2019

Commits on May 23, 2019

  1. bpo-36842: Implement PEP 578 (GH-12613)

    Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
    zooba committed May 23, 2019
Older