1. 06 Haz, 2019 1 kayıt (commit)
  2. 27 May, 2019 1 kayıt (commit)
    • Victor Stinner's avatar
      bpo-36763: Implement the PEP 587 (GH-13592) · 331a6a56
      Victor Stinner yazdı
      * 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()
      331a6a56
  3. 23 May, 2019 3 kayıt (commit)
  4. 22 May, 2019 2 kayıt (commit)
    • Victor Stinner's avatar
      bpo-36763: Rename private Python initialization functions (GH-13511) · 5edcf263
      Victor Stinner yazdı
      * Rename private C functions:
      
        * _Py_Initialize_ReconfigureCore => pyinit_core_reconfigure
        * _Py_InitializeCore_impl => pyinit_core_config
        * _Py_InitializeCore = > pyinit_core
        * _Py_InitializeMainInterpreter => pyinit_main
        * init_python => pyinit_python
      
      * Rename _testembed.c commands: add "test_" prefix.
      5edcf263
    • Victor Stinner's avatar
      bpo-36763: Add _PyPreConfig._config_init (GH-13481) · 022be02d
      Victor Stinner yazdı
      * _PyPreConfig_GetGlobalConfig() and  _PyCoreConfig_GetGlobalConfig()
        now do nothing if the configuration was not initialized with
        _PyPreConfig_InitCompatConfig() and _PyCoreConfig_InitCompatConfig()
      * Remove utf8_mode=-2 special case: use utf8_mode=-1 instead.
      * Fix _PyPreConfig_InitPythonConfig():
      
        * isolated = 0 instead of -1
        * use_environment = 1 instead of -1
      
      * Rename _PyConfig_INIT to  _PyConfig_INIT_COMPAT
      * Rename _PyPreConfig_Init() to _PyPreConfig_InitCompatConfig()
      * Rename _PyCoreConfig_Init() to _PyCoreConfig_InitCompatConfig()
      * PyInterpreterState_New() now uses _PyCoreConfig_InitPythonConfig()
        as default configuration, but it's very quickly overriden anyway.
      * _freeze_importlib.c uses _PyCoreConfig_SetString() to set
        program_name.
      * Cleanup preconfig_init_utf8_mode(): cmdline is always non-NULL.
      022be02d
  5. 20 May, 2019 2 kayıt (commit)
    • Victor Stinner's avatar
      bpo-36763: Fix encoding/locale tests in test_embed (GH-13443) · 425717fe
      Victor Stinner yazdı
      * Fix encoding and locale tests in test_embed.InitConfigTests.
      * InitConfigTests now only computes EXPECTED_CONFIG once.
      * Add tests for PYTHONWARNINGS and PYTHONPATH env vars
      425717fe
    • Victor Stinner's avatar
      bpo-36763: Fix Python preinitialization (GH-13432) · 6d1c4674
      Victor Stinner yazdı
      * Add _PyPreConfig.parse_argv
      * Add _PyCoreConfig._config_init field and _PyCoreConfigInitEnum enum
        type
      * Initialization functions: reject preconfig=NULL and config=NULL
      * Add config parameter to _PyCoreConfig_DecodeLocaleErr(): pass
        config->argv to _Py_PreInitializeFromPyArgv(), to parse config
        command line arguments in preinitialization.
      * Add config parameter to _PyCoreConfig_SetString(). It now
        preinitializes Python.
      * _PyCoreConfig_SetPyArgv() now also preinitializes Python for wide
        argv
      * Fix _Py_PreInitializeFromCoreConfig(): don't pass args to
        _Py_PreInitializeFromPyArgv() if config.parse_argv=0.
      * Use "char * const *" and "wchar_t * const *" types for 'argv'
        parameters and _PyArgv.argv.
      * Add unit test on preinitialization from argv.
      * _PyPreConfig.allocator type becomes int
      * Add _PyPreConfig_InitFromPreConfig() and
        _PyPreConfig_InitFromCoreConfig() helper functions
      6d1c4674
  6. 18 May, 2019 1 kayıt (commit)
    • Victor Stinner's avatar
      bpo-36763: Use _PyCoreConfig_InitPythonConfig() (GH-13398) · bab0db60
      Victor Stinner yazdı
      _PyPreConfig_InitPythonConfig() and _PyCoreConfig_InitPythonConfig()
      no longer inherit their values from global configuration variables.
      
      Changes:
      
      * _PyPreCmdline_Read() now ignores -X dev and PYTHONDEVMODE
        if dev_mode is already set.
      * Inline _PyPreConfig_INIT macro into _PyPreConfig_Init() function.
      * Inline _PyCoreConfig_INIT macro into _PyCoreConfig_Init() function.
      * Replace _PyCoreConfig_Init() with _PyCoreConfig_InitPythonConfig()
        in most tests of _testembed.c.
      * Replace _PyCoreConfig_Init() with _PyCoreConfig_InitIsolatedConfig()
        in _freeze_importlib.c.
      * Move some initialization functions from the internal
        to the private API.
      bab0db60
  7. 17 May, 2019 5 kayıt (commit)
    • Victor Stinner's avatar
      bpo-36763: Add _PyInitError functions (GH-13395) · 871ff77c
      Victor Stinner yazdı
      * Add _PyInitError functions:
      
        * _PyInitError_Ok()
        * _PyInitError_Error()
        * _PyInitError_NoMemory()
        * _PyInitError_Exit()
        * _PyInitError_IsError()
        * _PyInitError_IsExit()
        * _PyInitError_Failed()
      
      * frozenmain.c and _testembed.c now use functions rather than macros.
      * Move _Py_INIT_xxx() macros to the internal API.
      * Move _PyWstrList_INIT macro to the internal API.
      871ff77c
    • Victor Stinner's avatar
      bpo-36945: Add _PyPreConfig.configure_locale (GH-13368) · bcfbbd70
      Victor Stinner yazdı
      _PyPreConfig_InitIsolatedConfig() sets configure_locale to 0 to
      prevent Python to modify the LC_CTYPE locale. In that case,
      coerce_c_locale an coerce_c_locale_warn are set to 0 as well.
      bcfbbd70
    • Victor Stinner's avatar
      bpo-36763: Add _PyCoreConfig_InitPythonConfig() (GH-13388) · cab5d074
      Victor Stinner yazdı
      Add new functions to get the Python interpreter behavior:
      
      * _PyPreConfig_InitPythonConfig()
      * _PyCoreConfig_InitPythonConfig()
      
      Add new functions to get an isolated configuration:
      
      * _PyPreConfig_InitIsolatedConfig()
      * _PyCoreConfig_InitIsolatedConfig()
      
      Replace _PyPreConfig_INIT and _PyCoreConfig_INIT with new functions
      _PyPreConfig_Init() and _PyCoreConfig_Init().
      
      _PyCoreConfig: set configure_c_stdio and parse_argv to 0 by default
      to behave as Python 3.6 in the default configuration.
      
      _PyCoreConfig_Read() no longer sets coerce_c_locale_warn to 1 if it's
      equal to 0. coerce_c_locale_warn must now be set to -1 (ex: using
      _PyCoreConfig_InitPythonConfig()) to enable C locale coercion
      warning.
      
      Add unit tests for _PyCoreConfig_InitPythonConfig()
      and _PyCoreConfig_InitIsolatedConfig().
      
      Changes:
      
      * Rename _PyCoreConfig_GetCoreConfig() to _PyPreConfig_GetCoreConfig()
      * Fix core_read_precmdline(): handle parse_argv=0
      * Fix _Py_PreInitializeFromCoreConfig(): pass coreconfig.argv
        to _Py_PreInitializeFromPyArgv(), except if parse_argv=0
      cab5d074
    • Victor Stinner's avatar
      bpo-36763: Add PyMemAllocatorName (GH-13387) · b16b4e45
      Victor Stinner yazdı
      * Add PyMemAllocatorName enum
      * _PyPreConfig.allocator type becomes PyMemAllocatorName, instead of
        char*
      * Remove _PyPreConfig_Clear()
      * Add _PyMem_GetAllocatorName()
      * Rename _PyMem_GetAllocatorsName() to
        _PyMem_GetCurrentAllocatorName()
      * Remove _PyPreConfig_SetAllocator(): just call
        _PyMem_SetupAllocators() directly, we don't have do reallocate the
        configuration with the new allocator anymore!
      * _PyPreConfig_Write() parameter becomes const, as it should be in
        the first place!
      b16b4e45
    • Victor Stinner's avatar
      bpo-36763: Remove _PyCoreConfig.program (GH-13373) · fed02e15
      Victor Stinner yazdı
      Use _PyCoreConfig.program_name instead.
      fed02e15
  8. 16 May, 2019 3 kayıt (commit)
  9. 15 May, 2019 1 kayıt (commit)
  10. 14 May, 2019 1 kayıt (commit)
  11. 06 May, 2019 1 kayıt (commit)
  12. 02 May, 2019 3 kayıt (commit)
  13. 18 Nis, 2019 1 kayıt (commit)
  14. 29 Mar, 2019 1 kayıt (commit)
  15. 27 Mar, 2019 3 kayıt (commit)
    • Victor Stinner's avatar
      bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589) · d929f183
      Victor Stinner yazdı
      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.
      d929f183
    • Victor Stinner's avatar
    • Victor Stinner's avatar
      bpo-36444: Add _PyCoreConfig._init_main (GH-12572) · 484f20d2
      Victor Stinner yazdı
      * Add _PyCoreConfig._init_main: if equals to zero,
        _Py_InitializeFromConfig() doesn't call
        _Py_InitializeMainInterpreter().
      * Add interp_p parameter to _Py_InitializeFromConfig().
      * pymain_init() now calls _Py_InitializeFromConfig().
      * Make _Py_InitializeCore() private.
      484f20d2
  16. 26 Mar, 2019 3 kayıt (commit)
    • Victor Stinner's avatar
      bpo-36301: Test Python init with isolated (GH-12569) · 6da20a49
      Victor Stinner yazdı
      Add test_preinit_isolated1() and test_preinit_isolated2() test_embed.
      6da20a49
    • Victor Stinner's avatar
      bpo-36301: Cleanup preconfig.c and coreconfig.c (GH-12563) · f8ba6f5a
      Victor Stinner yazdı
      * _PyCoreConfig_Write() now updates _PyRuntime.preconfig
      * Remove _PyPreCmdline_Copy()
      * _PyPreCmdline_Read() now accepts _PyPreConfig and _PyCoreConfig
        optional configurations.
      * Rename _PyPreConfig_ReadFromArgv() to _PyPreConfig_Read(). Simplify
        the code.
      * Calling _PyCoreConfig_Read() no longer adds the warning options
        twice: don't add a warning option if it's already in the list.
      * Rename _PyCoreConfig_ReadFromArgv() to _PyCoreConfig_Read().
      * Rename config_from_cmdline() to _PyCoreConfig_ReadFromArgv().
      * Add more assertions on _PyCoreConfig in _PyCoreConfig_Read().
      * Move some functions.
      * Make some config functions private.
      f8ba6f5a
    • Victor Stinner's avatar
      bpo-36301: Remove _PyCoreConfig.preconfig (GH-12546) · 20004959
      Victor Stinner yazdı
      * Replace _PyCoreConfig.preconfig with 3 new fields in _PyCoreConfig:
        isolated, use_environment, dev_mode.
      * Add _PyPreCmdline.dev_mode.
      * Add _Py_PreInitializeFromPreConfigInPlace().
      20004959
  17. 25 Mar, 2019 1 kayıt (commit)
  18. 15 Mar, 2019 1 kayıt (commit)
    • Victor Stinner's avatar
      bpo-36301: Add _PyWstrList structure (GH-12343) · 74f6568b
      Victor Stinner yazdı
      Replace messy _Py_wstrlist_xxx() functions with a new clean
      _PyWstrList structure and new _PyWstrList_xxx() functions.
      
      Changes:
      
      * Add _PyCoreConfig.use_module_search_paths to decide if
        _PyCoreConfig.module_search_paths should be computed or not, to
        support empty search path list.
      * _PyWstrList_Clear() sets length to 0 and items to NULL, whereas
        _Py_wstrlist_clear() only freed memory.
      * _PyWstrList_Append() returns an int, whereas _Py_wstrlist_append()
        returned _PyInitError.
      * _PyWstrList uses Py_ssize_t for the length, instead of int.
      * Replace (int, wchar_t**) with _PyWstrList in:
      
        * _PyPreConfig
        * _PyCoreConfig
        * _PyPreCmdline
        * _PyCmdline
      
      * Replace "int orig_argv; wchar_t **orig_argv;"
        with "_PyWstrList orig_argv".
      * _PyCmdline and _PyPreCmdline now also copy wchar_argv.
      * Rename _PyArgv_Decode() to _PyArgv_AsWstrList().
      * PySys_SetArgvEx() now pass the fixed (argc, argv) to
        _PyPathConfig_ComputeArgv0() (don't pass negative argc or NULL
        argv).
      * _PyOS_GetOpt() uses Py_ssize_t
      74f6568b
  19. 06 Mar, 2019 1 kayıt (commit)
    • Victor Stinner's avatar
      bpo-36142: PYTHONMALLOC overrides PYTHONDEV (GH-12191) · 25d13f37
      Victor Stinner yazdı
      bpo-34247, bpo-36142: The PYTHONMALLOC environment variable has the
      priority over PYTHONDEV env var and "-X dev" command line option.
      For example, PYTHONMALLOC=malloc PYTHONDEVMODE=1 sets the memory
      allocators to "malloc" (and not to "debug").
      
      Add an unit test.
      25d13f37
  20. 05 Mar, 2019 4 kayıt (commit)
  21. 01 Mar, 2019 1 kayıt (commit)
    • Victor Stinner's avatar
      bpo-36142: Rework error reporting in pymain_main() (GH-12113) · dfe88475
      Victor Stinner yazdı
      Add a new _Py_INIT_EXIT() macro to be able to exit Python with an
      exitcode using _PyInitError API. Rewrite function calls by
      pymain_main() to use _PyInitError.
      
      Changes:
      
      * Remove _PyMain.err and _PyMain.status field
      * Add _Py_INIT_EXIT() macro and _PyInitError.exitcode field.
      * Rename _Py_FatalInitError() to _Py_ExitInitError().
      dfe88475