[New-bugs-announce] [issue25771] importlib: '.submodule' is not a relative name (no leading dot)

Martin Panter report at bugs.python.org
Tue Dec 1 00:31:34 EST 2015


New submission from Martin Panter:

>>> import importlib.util
>>> importlib.util.resolve_name(".submodule", None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/proj/python/cpython/Lib/importlib/util.py", line 26, in resolve_name
    '(no leading dot)'.format(name))
ValueError: '.submodule' is not a relative name (no leading dot)

This message sounds like nonsense. Perhaps the it should say something like:

    '.submodule' should be an absolute name (no leading dot)

or:

    relative import of '.submodule' not allowed outside of a package

----------
keywords: easy
messages: 255642
nosy: martin.panter
priority: normal
severity: normal
status: open
title: importlib: '.submodule' is not a relative name (no leading dot)
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6

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


More information about the New-bugs-announce mailing list