Issue #9425: Create PyModule_GetFilenameObject() function · pythoncapi/cpython@6c00c14 · GitHub
Skip to content

Commit 6c00c14

Browse files
author
Victor Stinner
committed
Issue python#9425: Create PyModule_GetFilenameObject() function
... to get the filename as a unicode object, instead of a byte string. Function needed to support unencodable filenames. Deprecate PyModule_GetFilename() in favor on the new function.
1 parent 6951157 commit 6c00c14

4 files changed

Lines changed: 32 additions & 9 deletions

File tree

Doc/c-api/module.rst

Lines changed: 13 additions & 2 deletions

Include/moduleobject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ PyAPI_FUNC(PyObject *) PyModule_New(const char *);
1616
PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *);
1717
PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);
1818
PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);
19+
PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);
1920
PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
2021
PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*);
2122
PyAPI_FUNC(void*) PyModule_GetState(PyObject*);

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ What's New in Python 3.2 Alpha 2?
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #9425: Create PyModule_GetFilenameObject() function to get the filename
16+
as a unicode object, instead of a byte string. Function needed to support
17+
unencodable filenames. Deprecate PyModule_GetFilename() in favor on the new
18+
function.
19+
1520
- Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
1621

1722
- Issue #9612: The set object is now 64-bit clean under Windows.

Objects/moduleobject.c

Lines changed: 13 additions & 7 deletions

0 commit comments

Comments
 (0)