Clarify the situation with the memory allocation for `PyConfig.home`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
Documentation
https://docs.python.org/3/c-api/init_config.html#c.PyConfig.home
Empirically, it seems that CPython expects this value to be allocated with malloc() as it will try to free() it when finalizing the environment. This is in stark contrast to the now deprecated Py_SetPythonHome which expected that the value is statically allocated.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the PyConfig.home entry in the C API initialization-configuration documentation and compare its stated ownership rules with the deprecated Py_SetPythonHome behavior. Verify whether the value must be allocated with malloc() and freed by CPython, then update the documentation to clearly describe the required allocation and lifetime.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100