Here's a patch for astng-0.19.3 to allow it to properly import eggs with
Windows line endings. This fixes a problem with pylint not being able
to import setuptools.
*** C:\src\logilab\logilab-astng-0.19.3\builder.py 2009-12-18
05:38:51.000000000 -0500
---
C:\Python25\Lib\site-packages\logilab_astng-0.19.3-py2.5.egg\logilab\astng\builder.py
2010-01-13 08:44:25.000000000 -0500
***************
*** 126,130 ****
def string_build(self, data, modname='', path=None):
"""build astng from a source code stream (i.e. from an ast)"""
! return self.ast_build(parse(data + '\n'), modname, path)
def ast_build(self, node, modname='', path=None):
--- 126,130 ----
def string_build(self, data, modname='', path=None):
"""build astng from a source code stream (i.e. from an ast)"""
! return self.ast_build(parse(data.replace('\r\n', '\n') +
'\n'), modname, path)
def ast_build(self, node, modname='', path=None):
Thanks.
--Ned.
-------- Original Message --------
Subject: Re: Pylint bug: F0401: 43: Unable to import 'setuptools'
Date: Wed, 13 Jan 2010 10:06:51 +0100
From: Sylvain Thénault <sylvain.thena...@logilab.fr>
Reply-To: Sylvain Thénault <sylvain.thena...@logilab.fr>
To: Ned Batchelder <n...@nedbatchelder.com>
References: <4b3b62a9.3090...@nedbatchelder.com>
On 30 décembre 09:24, Ned Batchelder wrote:
Hi Sylvain,
Hi Ned,
I'm having trouble with the latest pylint (0.19.0). It claims not
to be able to import setuptools, even though the code works fine,
and at a command prompt I can import setuptools. I traced the
problem through the pylint code, and it's because I have a
setuptools egg, and the Python code extracted from the egg has \r\n
line endings, and those are passed verbatim to compile(). The
compile() function needs to have line endings cleaned to \n, so a
SyntaxError is raised, preventing the analysis of the import.
Gargl. Would you have a patch that solve this ? that would be great...
BTW: I tried to create a ticket on the logilab.fr site, but could
not figure out how. I'm a registered user, and I found the view of
99 existing tickets, but didn't see a way to create a new one.
This is not (yet) clear, but one your account is created, you can register
to notification, add signed comments, but not adding new ticket. One should
simply ask to get ticket submission permission on project. I've granted it to
you on the pylint/astng/common projects.
BTW, please use python-projects@lists.logilab.org instead of my personal email
for such discussion.
Thanks for your report, cheers
--
Sylvain Thénault LOGILAB, Paris (France)
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
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects