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 <rep...@bugs.python.org>
<http://bugs.python.org/issue15610>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to