Hi all,

I'm running pylint over my Mailman 3 code and it seems to break when there's a relative import that can satisfy a name, even if "from __future__ import absolute_import" appears in the module. I'm using Python 2.6 and pylint 0.18.

src/mailman/bin/arch.py:141: [W0331] Use of the <> operator
src/mailman/bin/arch.py:117: [W0511] XXX processUnixMailbox() should refresh the lock.
src/mailman/bin/arch.py:1: [C0111] Missing docstring
src/mailman/bin/arch.py:28: [E0611] No name 'i18n' in module 'mailman'
src/mailman/bin/arch.py:28: [W0403] Relative import 'mailman'
src/mailman/bin/arch.py:29: [E0611] No name 'Archiver' in module 'mailman' src/mailman/bin/arch.py:29: [W0403] Relative import 'mailman.Archiver.HyperArch'
Traceback (most recent call last):
  File "bin/pylint", line 14, in <module>
    pylint.lint.Run(sys.argv[1:])
File "/Users/barry/.buildout/eggs/pylint-0.18.0-py2.6.egg/pylint/ lint.py", line 881, in __init__
    linter.check(args)
File "/Users/barry/.buildout/eggs/pylint-0.18.0-py2.6.egg/pylint/ lint.py", line 500, in check
    self.check_astng_module(astng, checkers)
File "/Users/barry/.buildout/eggs/pylint-0.18.0-py2.6.egg/pylint/ lint.py", line 577, in check_astng_module
    if implements(checker, IASTNGChecker)])
File "/Users/barry/.buildout/eggs/pylint-0.18.0-py2.6.egg/pylint/ lint.py", line 594, in astng_events
    self.astng_events(child, checkers, _reversed_checkers)
File "/Users/barry/.buildout/eggs/pylint-0.18.0-py2.6.egg/pylint/ lint.py", line 591, in astng_events
    checker.visit(astng)
File "/Users/barry/.buildout/eggs/logilab_astng-0.19.0-py2.6.egg/ logilab/astng/utils.py", line 320, in visit
    method(node)
File "/Users/barry/.buildout/eggs/pylint-0.18.0-py2.6.egg/pylint/ checkers/imports.py", line 262, in visit_from
    fullname = get_module_part(fullname,context_file=node.root().file)
File "/Users/barry/.buildout/eggs/logilab_common-0.44.0-py2.6.egg/ logilab/common/modutils.py", line 323, in get_module_part
    path=path, context_file=context_file)
File "/Users/barry/.buildout/eggs/logilab_common-0.44.0-py2.6.egg/ logilab/common/modutils.py", line 267, in file_from_modpath
    return _file_from_modpath(modpath, path, context)
File "/Users/barry/.buildout/eggs/logilab_common-0.44.0-py2.6.egg/ logilab/common/modutils.py", line 548, in _file_from_modpath
    mtype, mp_filename = _module_file(modpath, path)
File "/Users/barry/.buildout/eggs/logilab_common-0.44.0-py2.6.egg/ logilab/common/modutils.py", line 609, in _module_file
    return _search_zip(modpath, pic)[:2]
File "/Users/barry/.buildout/eggs/logilab_common-0.44.0-py2.6.egg/ logilab/common/modutils.py", line 571, in _search_zip
    raise ImportError('No module named %s' % '.'.join(modpath))
ImportError: No module named Archiver

There is a mailman.py module in the same directory as the src/mailman/ bin/arch.py module. Both modules have this at the top:

from __future__ import absolute_import

There's also a subpackage called mailman.Archiver, but apparently pylint is still doing a relative import and not getting the upper package name.

-Barry

Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to