[New-bugs-announce] [issue35358] avoid '-' in importlib.import_module and builtins.__import__

Stéphane Wirtel report at bugs.python.org
Fri Nov 30 03:30:51 EST 2018


New submission from Stéphane Wirtel <stephane at wirtel.be>:

maybe related to this issue: https://bugs.python.org/issue18831

we can't import a module where the name contains '-', for example

from my-module import my_function

but with importlib.import_module

we can import this module.

import_module does not respect the python syntax for the name of the module, we should avoid that.

1. Add a DeprecationWarning for 3.8+
2. in 3.10, remove this DeprecationWarning and remove the support of the '-' in importlib.import_module

----------
messages: 330761
nosy: matrixise
priority: normal
severity: normal
status: open
title: avoid '-' in importlib.import_module and builtins.__import__
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

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


More information about the New-bugs-announce mailing list