[issue9292] Dead code in Modules/pyexpat.c

Antoine Pitrou report at bugs.python.org
Sun Jul 18 15:44:26 CEST 2010


New submission from Antoine Pitrou <pitrou at free.fr>:

There's some dead code in xmlparse_ParseFile() in Modules/pyexpat.c: the file pointer "fp" is always NULL, and as such the following code can never get entered into:

        if (fp) {
            bytes_read = fread(buf, sizeof(char), BUF_SIZE, fp);
            if (bytes_read < 0) {
                PyErr_SetFromErrno(PyExc_IOError);
                return NULL;
            }
        }

There might be similar situations in other methods.

----------
components: Extension Modules
messages: 110646
nosy: akuchling, christian.heimes, pitrou
priority: low
severity: normal
stage: needs patch
status: open
title: Dead code in Modules/pyexpat.c
versions: Python 3.1, Python 3.2

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


More information about the Python-bugs-list mailing list