This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients pacampbell, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2022-01-08.12:06:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1641643591.09.0.670275442904.issue46303@roundup.psfhosted.org>
In-reply-to
Content
It's not the first time that private functions included by the public Python.h are causing build errors event if these functions are not used. The previous issue were functions for atomic operations. I solved this build error by moving the whole private C API into the internal C API: Include/internal/pycore_atomic.h. Since that time, we no longer got build error related to this header file.

I propose a similar fix: move all private fileutils.h functions from Include/cpython/fileutils.h to the internal Include/internal/pycore_fileutils.h.

I wrote PR 30484 to implement this change.

To keep the implementation simple, I kept _Py_fopen_obj() in Include/cpython/fileutils.h, for _testcapi which must not use the internal C API.

If this PR is merged, for Python 3.9 and 3.10, I will write a simpler change: modify Include/cpython/fileutils.h to only define functions using "struct stat" in the internal C API (if Py_BUILD_CORE is defined).
History
Date User Action Args
2022-01-08 12:06:31vstinnersetrecipients: + vstinner, paul.moore, tim.golden, zach.ware, steve.dower, pacampbell
2022-01-08 12:06:31vstinnersetmessageid: <1641643591.09.0.670275442904.issue46303@roundup.psfhosted.org>
2022-01-08 12:06:31vstinnerlinkissue46303 messages
2022-01-08 12:06:30vstinnercreate