[New-bugs-announce] [issue15610] PyImport_ImportModuleEx always fails in 3.3 with "ValueError: level must be >= 0"
Dave Malcolm
report at bugs.python.org
Thu Aug 9 22:04:08 CEST 2012
New submission from Dave Malcolm:
I've been testing various 3rd-party python code against 3.3b1, and see
ValueError: level must be >= 0
exceptions where C code is using PyImport_ImportModuleEx.
PyImport_ImportModuleEx reads as
63 #define PyImport_ImportModuleEx(n, g, l, f) \
64 PyImport_ImportModuleLevel(n, g, l, f, -1)
within http://hg.python.org/cpython/file/aaa68dce117e/Include/import.h as of now (2012-08-09)
Within PyImport_ImportModuleLevel there's this check:
1280 if (level < 0) {
1281 PyErr_SetString(PyExc_ValueError, "level must be >= 0");
1282 goto error;
1283 }
which thus always fires.
So it would seem that currently any usage of PyImport_ImportModuleEx will fail.
----------
components: Interpreter Core
messages: 167828
nosy: dmalcolm
priority: normal
severity: normal
status: open
title: PyImport_ImportModuleEx always fails in 3.3 with "ValueError: level must be >= 0"
type: behavior
versions: Python 3.3, Python 3.4
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15610>
_______________________________________
More information about the New-bugs-announce
mailing list