Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Oct 13, 2021

Move Include/pystrhex.h to Include/internal/pycore_strhex.h.
The header file only contains private functions.

The following C extensions are now built with Py_BUILD_CORE_MODULE
macro defined to get access to the internal C API:

  • _blake2
  • _hashopenssl
  • _md5
  • _sha1
  • _sha3
  • _ssl
  • binascii

https://bugs.python.org/issue45434

Move Include/pystrhex.h to Include/internal/pycore_strhex.h.
The header file only contains private functions.

The following C extensions are now built with Py_BUILD_CORE_MODULE
macro defined to get access to the internal C API:

* _blake2
* _hashopenssl
* _md5
* _sha1
* _sha3
* _ssl
* binascii
@vstinner
Copy link
Member Author

In the PyPI top 5000 packages, a single package uses the pystrhex.h private functions: the pysha3 package uses the private function _Py_strhex().

$ ./search_pypi_top_5000.sh _Py_strhex
pypi-top-5000_2021-08-17/pysha3-1.0.2.tar.gz
pypi-top-5000_2021-08-17/graphene-federation-0.1.0.tar.gz
pypi-top-5000_2021-08-17/frozendict-2.0.6.tar.gz
  • pysha3-1.0.2.tar.gz: #include "pystrhex.h", it has a copy of the code for Python 3.4 and older
  • graphene-federation-0.1.0.tar.gz: false alarm, it contains a virtual environment which contains python executable files
  • frozendict-2.0.6.tar.gz: false alarm, it contains a copy of the Include/pystrhex.h file.

@vstinner
Copy link
Member Author

the pysha3 package uses the private function _Py_strhex()

https://pypi.org/project/pysha3/ is a backport of the Python stdlib _sha3 module for Python 2.7-3.6. The latest release was published in 2017. Since this project only makes sense on Python 3.6 and older, I don't think that we should bother with this module. It should not be used on Python 3.11 which already provides a maintained _sha3 module.

@vstinner vstinner merged commit bbe7497 into python:main Oct 13, 2021
@vstinner vstinner deleted the pystrhex branch October 13, 2021 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants