[New-bugs-announce] [issue11742] Possible bug in Python/import.c

Andrew Sommerville report at bugs.python.org
Sat Apr 2 17:42:11 CEST 2011


New submission from Andrew Sommerville <aksommerville at gmail.com>:

Around line 1509 in Python/import.c, function "find_module", the importer is trying to fail with "No module named...". It is possible for "fp" to be NULL and "fdp" (the return value) to be non-NULL, which callers would see as success.

Solution: add "fdp=NULL;" to this block:
    if (fp == NULL) {
        PyErr_Format(PyExc_ImportError,
                     "No module named %.200s", name);
    }

(my apologies if this is not the correct place to post...)

----------
components: Interpreter Core
messages: 132803
nosy: aksommerville
priority: normal
severity: normal
status: open
title: Possible bug in Python/import.c
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11742>
_______________________________________


More information about the New-bugs-announce mailing list