[New-bugs-announce] [issue12173] PyImport_ImportModuleLevel doesn't have 'const' on its argument

Chris Angelico report at bugs.python.org
Wed May 25 09:10:31 CEST 2011

New submission from Chris Angelico <rosuav at gmail.com>:

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).

components: Interpreter Core
files: importconst.patch
keywords: patch
messages: 136829
nosy: Rosuav
priority: normal
severity: normal
status: open
title: PyImport_ImportModuleLevel doesn't have 'const' on its argument
type: feature request
versions: Python 3.3
Added file: http://bugs.python.org/file22103/importconst.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list