gh-127350: Add Py_fopen() and Py_fclose() functions (#127821)

This commit is contained in:
Victor Stinner 2025-01-06 13:43:09 +01:00 committed by GitHub
parent 7e8c571604
commit f89e5e20cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 270 additions and 53 deletions

View file

@ -370,7 +370,7 @@ pymain_run_file_obj(PyObject *program_name, PyObject *filename,
return pymain_exit_err_print();
}
FILE *fp = _Py_fopen_obj(filename, "rb");
FILE *fp = Py_fopen(filename, "rb");
if (fp == NULL) {
// Ignore the OSError
PyErr_Clear();
@ -465,7 +465,7 @@ pymain_run_startup(PyConfig *config, int *exitcode)
goto error;
}
FILE *fp = _Py_fopen_obj(startup, "r");
FILE *fp = Py_fopen(startup, "r");
if (fp == NULL) {
int save_errno = errno;
PyErr_Clear();