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.

classification
Title: PyImport_ImportModuleLevel doesn't have 'const' on its argument
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Rosuav, brett.cannon, python-dev, vstinner
Priority: normal Keywords: needs review, patch

Created on 2011-05-25 07:10 by Rosuav, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
importconst.patch Rosuav, 2011-05-25 07:10 Patch to add 'const' to argument of PyImport_ImportModuleLevel review
Messages (2)
msg136829 - (view) Author: Chris Angelico (Rosuav) * Date: 2011-05-25 07:10
An anomaly in the argument types of similar functions: PyImport_ImportModuleLevel takes char *, while the related functions PyImport_AddModule, PyImport_ImportModule, and PyImport_ImportModuleNoBlock all take const char *. This made a nuisance of itself for me when I tried to compile my code against Python.h (embedding Python). Attached is a relatively trivial patch to add const. Should not impact existing code, as the compiler will happily pass a char* to a const char* (just not the other way).
msg136849 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-25 14:28
New changeset a9126e8770e5 by Benjamin Peterson in branch 'default':
make PyImport_ImportModuleLevel's first arg const like similiar functions (closes #12173)
http://hg.python.org/cpython/rev/a9126e8770e5
History
Date User Action Args
2022-04-11 14:57:17adminsetgithub: 56382
2011-05-25 14:28:49python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg136849

resolution: fixed
stage: patch review -> resolved
2011-05-25 07:12:24ezio.melottisetkeywords: + needs review
nosy: + brett.cannon, vstinner

stage: patch review
2011-05-25 07:10:30Rosuavcreate