<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Python/dynload_hpux.c, branch enum-lost-fixes</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/'/>
<entry>
<title>bpo-41894: Fix UnicodeDecodeError while loading native module (GH-22466)</title>
<updated>2020-10-15T01:53:27+00:00</updated>
<author>
<name>Kevin Adler</name>
<email>kadler@us.ibm.com</email>
</author>
<published>2020-10-15T01:53:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=2d2af320d94afc6561e8f8adf174c9d3fd9065bc'/>
<id>2d2af320d94afc6561e8f8adf174c9d3fd9065bc</id>
<content type='text'>
When running in a non-UTF-8 locale, if an error occurs while importing a
native Python module (say because a dependent share library is missing),
the error message string returned may contain non-ASCII code points
causing a UnicodeDecodeError.

PyUnicode_DecodeFSDefault is used for buffers which may contain
filesystem  paths. For consistency with os.strerror(),
PyUnicode_DecodeLocale is used for buffers which contain system error
messages. While the shortname parameter is always encoded in ASCII
according to PEP 489, it is left decoded using PyUnicode_FromString to
minimize the changes and since it should not affect the decoding (albeit
_potentially_ slower).

In dynload_hpux, since the error buffer contains a message generated
from a static ASCII string and the module filesystem path,
PyUnicode_DecodeFSDefault is used instead of PyUnicode_DecodeLocale as
is used elsewhere.

* bpo-41894: Fix bugs in dynload error msg handling

For both dynload_aix and dynload_hpux, properly handle the possibility
that decoding strings may return NULL and when such an error happens,
properly decrement any previously decoded strings and return early.

In addition, in dynload_aix, ensure that we pass the decoded string
*object* pathname_ob to PyErr_SetImportError instead of the original
pathname buffer.

Co-authored-by: Serhiy Storchaka &lt;storchaka@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When running in a non-UTF-8 locale, if an error occurs while importing a
native Python module (say because a dependent share library is missing),
the error message string returned may contain non-ASCII code points
causing a UnicodeDecodeError.

PyUnicode_DecodeFSDefault is used for buffers which may contain
filesystem  paths. For consistency with os.strerror(),
PyUnicode_DecodeLocale is used for buffers which contain system error
messages. While the shortname parameter is always encoded in ASCII
according to PEP 489, it is left decoded using PyUnicode_FromString to
minimize the changes and since it should not affect the decoding (albeit
_potentially_ slower).

In dynload_hpux, since the error buffer contains a message generated
from a static ASCII string and the module filesystem path,
PyUnicode_DecodeFSDefault is used instead of PyUnicode_DecodeLocale as
is used elsewhere.

* bpo-41894: Fix bugs in dynload error msg handling

For both dynload_aix and dynload_hpux, properly handle the possibility
that decoding strings may return NULL and when such an error happens,
properly decrement any previously decoded strings and return early.

In addition, in dynload_aix, ensure that we pass the decoded string
*object* pathname_ob to PyErr_SetImportError instead of the original
pathname buffer.

Co-authored-by: Serhiy Storchaka &lt;storchaka@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-40268: Add _PyInterpreterState_GetConfig() (GH-19492)</title>
<updated>2020-04-13T01:04:28+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-04-13T01:04:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=da7933ecc30e37b119756cb02b89a6ad99db22e0'/>
<id>da7933ecc30e37b119756cb02b89a6ad99db22e0</id>
<content type='text'>
Don't access PyInterpreterState.config member directly anymore, but
use new functions:

* _PyInterpreterState_GetConfig()
* _PyInterpreterState_SetConfig()
* _Py_GetConfig()</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't access PyInterpreterState.config member directly anymore, but
use new functions:

* _PyInterpreterState_GetConfig()
* _PyInterpreterState_SetConfig()
* _Py_GetConfig()</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-36900: Fix compilation on HP-UX (GH-13614)</title>
<updated>2019-05-28T10:24:00+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@redhat.com</email>
</author>
<published>2019-05-28T10:24:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=9ea277a788eabec102e8fe613b7f1e27995d5918'/>
<id>9ea277a788eabec102e8fe613b7f1e27995d5918</id>
<content type='text'>
dynload_hpux.c: add #include "pycore_pystate.h" for
_PyInterpreterState_GET_UNSAFE().</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dynload_hpux.c: add #include "pycore_pystate.h" for
_PyInterpreterState_GET_UNSAFE().</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-36763: Implement the PEP 587 (GH-13592)</title>
<updated>2019-05-27T14:39:22+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@redhat.com</email>
</author>
<published>2019-05-27T14:39:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=331a6a56e9a9c72f3e4605987fabdaec72677702'/>
<id>331a6a56e9a9c72f3e4605987fabdaec72677702</id>
<content type='text'>
* 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 =&gt; Python/initconfig.c
  * Include/cpython/coreconfig.h =&gt; Include/cpython/initconfig.h
  * Include/internal/: pycore_coreconfig.h =&gt; pycore_initconfig.h

* Rename structures

  * _PyCoreConfig =&gt; PyConfig
  * _PyPreConfig =&gt; PyPreConfig
  * _PyInitError =&gt; PyStatus
  * _PyWstrList =&gt; PyWideStringList

* Rename PyConfig fields:

  * use_module_search_paths =&gt; module_search_paths_set
  * module_search_path_env =&gt; pythonpath_env

* Rename PyStatus field: _func =&gt; func
* PyInterpreterState: rename core_config field to config
* Rename macros and functions:

  * _PyCoreConfig_SetArgv() =&gt; PyConfig_SetBytesArgv()
  * _PyCoreConfig_SetWideArgv() =&gt; PyConfig_SetArgv()
  * _PyCoreConfig_DecodeLocale() =&gt; PyConfig_SetBytesString()
  * _PyInitError_Failed() =&gt; PyStatus_Exception()
  * _Py_INIT_ERROR_TYPE_xxx enums =&gt; _PyStatus_TYPE_xxx
  * _Py_UnixMain() =&gt; Py_BytesMain()
  * _Py_ExitInitError() =&gt; Py_ExitStatusException()
  * _Py_PreInitializeFromArgs() =&gt; Py_PreInitializeFromBytesArgs()
  * _Py_PreInitializeFromWideArgs() =&gt; Py_PreInitializeFromArgs()
  * _Py_PreInitialize() =&gt; Py_PreInitialize()
  * _Py_RunMain() =&gt; Py_RunMain()
  * _Py_InitializeFromConfig() =&gt; Py_InitializeFromConfig()
  * _Py_INIT_XXX() =&gt; _PyStatus_XXX()
  * _Py_INIT_FAILED() =&gt; _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()</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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 =&gt; Python/initconfig.c
  * Include/cpython/coreconfig.h =&gt; Include/cpython/initconfig.h
  * Include/internal/: pycore_coreconfig.h =&gt; pycore_initconfig.h

* Rename structures

  * _PyCoreConfig =&gt; PyConfig
  * _PyPreConfig =&gt; PyPreConfig
  * _PyInitError =&gt; PyStatus
  * _PyWstrList =&gt; PyWideStringList

* Rename PyConfig fields:

  * use_module_search_paths =&gt; module_search_paths_set
  * module_search_path_env =&gt; pythonpath_env

* Rename PyStatus field: _func =&gt; func
* PyInterpreterState: rename core_config field to config
* Rename macros and functions:

  * _PyCoreConfig_SetArgv() =&gt; PyConfig_SetBytesArgv()
  * _PyCoreConfig_SetWideArgv() =&gt; PyConfig_SetArgv()
  * _PyCoreConfig_DecodeLocale() =&gt; PyConfig_SetBytesString()
  * _PyInitError_Failed() =&gt; PyStatus_Exception()
  * _Py_INIT_ERROR_TYPE_xxx enums =&gt; _PyStatus_TYPE_xxx
  * _Py_UnixMain() =&gt; Py_BytesMain()
  * _Py_ExitInitError() =&gt; Py_ExitStatusException()
  * _Py_PreInitializeFromArgs() =&gt; Py_PreInitializeFromBytesArgs()
  * _Py_PreInitializeFromWideArgs() =&gt; Py_PreInitializeFromArgs()
  * _Py_PreInitialize() =&gt; Py_PreInitialize()
  * _Py_RunMain() =&gt; Py_RunMain()
  * _Py_InitializeFromConfig() =&gt; Py_InitializeFromConfig()
  * _Py_INIT_XXX() =&gt; _PyStatus_XXX()
  * _Py_INIT_FAILED() =&gt; _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()</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-36900: Replace global conf vars with config (GH-13299)</title>
<updated>2019-05-14T15:34:56+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@redhat.com</email>
</author>
<published>2019-05-14T15:34:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=c96be811fa7da8ddcea18cc7abcae94e0f5ff966'/>
<id>c96be811fa7da8ddcea18cc7abcae94e0f5ff966</id>
<content type='text'>
Replace global configuration variables with core_config read from the
current interpreter.

Cleanup dynload_hpux.c.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace global configuration variables with core_config read from the
current interpreter.

Cleanup dynload_hpux.c.</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #24268: Fix import naming when loading extension modules. Patch by Petr Viktorin.</title>
<updated>2015-05-23T21:13:41+00:00</updated>
<author>
<name>Steve Dower</name>
<email>steve.dower@microsoft.com</email>
</author>
<published>2015-05-23T21:13:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=adc2fb8a6a8d98f32eea2d1022f14cadfdf915e3'/>
<id>adc2fb8a6a8d98f32eea2d1022f14cadfdf915e3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>PEP 489: Multi-phase extension module initialization</title>
<updated>2015-05-23T12:24:10+00:00</updated>
<author>
<name>Nick Coghlan</name>
<email>ncoghlan@gmail.com</email>
</author>
<published>2015-05-23T12:24:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=d5cacbb1d9c3edc02bf0ba01702e7c06da5bc318'/>
<id>d5cacbb1d9c3edc02bf0ba01702e7c06da5bc318</id>
<content type='text'>
Known limitations of the current implementation:

- documentation changes are incomplete
- there's a reference leak I haven't tracked down yet

The leak is most visible by running:

  ./python -m test -R3:3 test_importlib

However, you can also see it by running:

  ./python -X showrefcount

Importing the array or _testmultiphase modules, and
then deleting them from both sys.modules and the local
namespace shows significant increases in the total
number of active references each cycle. By contrast,
with _testcapi (which continues to use single-phase
initialisation) the global refcounts stabilise after
a couple of cycles.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Known limitations of the current implementation:

- documentation changes are incomplete
- there's a reference leak I haven't tracked down yet

The leak is most visible by running:

  ./python -m test -R3:3 test_importlib

However, you can also see it by running:

  ./python -X showrefcount

Importing the array or _testmultiphase modules, and
then deleting them from both sys.modules and the local
namespace shows significant increases in the total
number of active references each cycle. By contrast,
with _testcapi (which continues to use single-phase
initialisation) the global refcounts stabilise after
a couple of cycles.
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #13959: Re-implement imp.get_suffixes() in Lib/imp.py.</title>
<updated>2012-05-04T19:20:40+00:00</updated>
<author>
<name>Brett Cannon</name>
<email>brett@python.org</email>
</author>
<published>2012-05-04T19:20:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=2657df47449dd5d324985a5eb43b937217e0d7e0'/>
<id>2657df47449dd5d324985a5eb43b937217e0d7e0</id>
<content type='text'>
This introduces a new function, imp.extension_suffixes(), which is
currently undocumented. That is forthcoming once issue #14657 is
resolved and how to expose file suffixes is decided.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This introduces a new function, imp.extension_suffixes(), which is
currently undocumented. That is forthcoming once issue #14657 is
resolved and how to expose file suffixes is decided.
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #14599: Support ImportError.path on AIX and HPUX when loading</title>
<updated>2012-04-20T19:31:11+00:00</updated>
<author>
<name>Brett Cannon</name>
<email>brett@python.org</email>
</author>
<published>2012-04-20T19:31:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=3dfc22cc048da44c21cb95996522696d8c679fc9'/>
<id>3dfc22cc048da44c21cb95996522696d8c679fc9</id>
<content type='text'>
extension modules.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
extension modules.
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #14040: Remove rarely used file name suffixes for C extensions (under POSIX mainly).</title>
<updated>2012-02-20T18:41:11+00:00</updated>
<author>
<name>Antoine Pitrou</name>
<email>solipsis@pitrou.net</email>
</author>
<published>2012-02-20T18:41:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=c229e6e8ff6de61581f59266dc553f04f2c870c3'/>
<id>c229e6e8ff6de61581f59266dc553f04f2c870c3</id>
<content type='text'>
This will improve import performance a bit (especially under importlib).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This will improve import performance a bit (especially under importlib).
</pre>
</div>
</content>
</entry>
</feed>
