Hi,

sorry for the late answer. I've added a ticket for your problem:
http://www.logilab.org/ticket/253517. It seems related to
https://bitbucket.org/logilab/pylint/issue/203/importing-namespace-packages-crashes.

Thank you for the report.

On 23 mai 15:46, kris kvilekval wrote:
> 
> I am using pip to install all dependencies of new packages and am
> running into a few issues (see error at end of email).
> 
> The following patch seems to remove the issue.  Not sure why imports of
> names space packages had to be greater
> than one, but it seems like pip installs namespaces differently than
> easy_install did. 
> 
> 
> $ hg diff 
> diff --git a/modutils.py b/modutils.py
> --- a/modutils.py
> +++ b/modutils.py
> @@ -612,11 +612,14 @@
>      except AttributeError:
>          checkeggs = False
>      # pkg_resources support (aka setuptools namespace packages)
> -    if pkg_resources is not None and modpath[0] in 
> pkg_resources._namespace_packages and len(modpath) > 1:
> +#    if pkg_resources is not None and modpath[0] in 
> pkg_resources._namespace_packages and len(modpath) > 1:
> +    if pkg_resources is not None and modpath[0] in 
> pkg_resources._namespace_packages:#
>          # setuptools has added into sys.modules a module object with proper
>          # __path__, get back information from there
>          module = sys.modules[modpath.pop(0)]
>          path = module.__path__
> +        mtype = PKG_DIRECTORY
> +        mp_filename = path[0]
>      imported = []
>      while modpath:
>          modname = modpath[0]
> 
> 
> 
> =======================================================================
> 
> 
> 
> $ paver pylint bqserver/bq/module_service/controllers/module_server.py
> ---> pavement.pylint
> PYTHONPATH=bqcore/bq:bqserver/bq:bqengine/bq:bqfeature/bq pylint 
> bqserver/bq/module_service/controllers/module_server.py 
> --rcfile=bqcore/pylint.rc
> ************* Module bq.module_service.controllers.module_server
> I0011:330,0:  Locally disabling dangerous-default-value (W0102)
> Traceback (most recent call last):
>   File "/home/kgk/work/bisque/bq055/bqenv/bin/pylint", line 9, in <module>
>     load_entry_point('pylint==1.2.1', 'console_scripts', 'pylint')()
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/pylint/__init__.py",
>  line 21, in run_pylint
>     Run(sys.argv[1:])
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/pylint/lint.py",
>  line 1051, in __init__
>     linter.check(args)
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/pylint/lint.py",
>  line 626, in check
>     self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers)
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/pylint/lint.py",
>  line 712, in check_astroid_module
>     walker.walk(astroid)
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/pylint/utils.py",
>  line 715, in walk
>     self.walk(child)
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/pylint/utils.py",
>  line 712, in walk
>     cb(astroid)
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/pylint/checkers/imports.py",
>  line 269, in visit_from
>     self._add_imported_module(node, '%s.%s' % (importedmodnode.name, name))
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/pylint/checkers/imports.py",
>  line 302, in _add_imported_module
>     importedmodname = get_module_part(importedmodname)
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/logilab/common/modutils.py",
>  line 352, in get_module_part
>     path=path, context_file=context_file)
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/logilab/common/modutils.py",
>  line 297, in file_from_modpath
>     return _file_from_modpath(modpath, path, context)
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/logilab/common/modutils.py",
>  line 556, in _file_from_modpath
>     mtype, mp_filename = _module_file(modpath, path)
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/logilab/common/modutils.py",
>  line 636, in _module_file
>     return _search_zip(modpath, pic)[:2]
>   File 
> "/home/kgk/work/bisque/bq055/bqenv/lib/python2.6/site-packages/logilab/common/modutils.py",
>  line 577, in _search_zip
>     raise ImportError('No module named %s' % '.'.join(modpath))
> ImportError: No module named paste
> 
> 
> Captured Task Output:
> 
> 
> 
> _______________________________________________
> code-quality mailing list
> code-quality@python.org
> https://mail.python.org/mailman/listinfo/code-quality
> 

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org
_______________________________________________
code-quality mailing list
code-quality@python.org
https://mail.python.org/mailman/listinfo/code-quality

Reply via email to