[issue38721] modulefinder should use io.open_code() instead of open()

Dominic Littlewood report at bugs.python.org
Wed Nov 6 11:05:22 EST 2019


New submission from Dominic Littlewood <11dlittlewood at gmail.com>:

modulefinder currently will detect modules imported by a script dynamically by running the script, and to do this it has to open the script as a file.

This would also fix what appears to be a bug where modulefinder failed to open files in bytes mode sometimes, causing it to fail for some modules (like functools) if the wrong encoding is used. I say "appears to be", because the structure of the module seems to imply this was intended behaviour, but I can't think why anyone would want this.

This is similar to two other issues I'm posting, but they're in different modules, so different bugs.

----------
components: Library (Lib)
messages: 356143
nosy: plokmijnuhby
priority: normal
severity: normal
status: open
title: modulefinder should use io.open_code() instead of open()
type: security
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38721>
_______________________________________


More information about the Python-bugs-list mailing list