Andrew Berg | 14 Feb 01:19 2012
Picon

Can't run pylint, astng returns NameError

C:\Users\IAmTheClaw\workspace\NoiseBot>c:\Python32\python.exe
c:\Python32\Scripts\pylint noisebot.py
No config file found, using default configuration
Traceback (most recent call last):
  File "c:\Python32\Scripts\pylint", line 4, in <module>
    lint.Run(sys.argv[1:])
  File "c:\Python32\lib\site-packages\pylint\lint.py", line 879, in __init__
    linter.check(args)
  File "c:\Python32\lib\site-packages\pylint\lint.py", line 502, in check
    self.check_astng_module(astng, walker, rawcheckers)
  File "c:\Python32\lib\site-packages\pylint\lint.py", line 564, in
check_astng_module
    self.process_module(astng)
  File "c:\Python32\lib\site-packages\pylint\checkers\__init__.py", line
122, in process_module
    stream = node.file_stream
  File "c:\Python32\lib\site-packages\logilab\astng\scoped_nodes.py",
line 249, in file_stream
    return file(self.file)
NameError: global name 'file' is not defined

I have no idea what causes this, but I haven't looked at logilab-astng's
source. Is pylint not compatible with py3k? It says any Python version
>= 2.5...

Using CPython 3.2.2 on Windows 7.
Thomas Kluyver | 14 Feb 01:24 2012
Picon

Re: Can't run pylint, astng returns NameError

On 14 February 2012 00:19, Andrew Berg <bahamutzero8825 <at> gmail.com> wrote:
> I have no idea what causes this, but I haven't looked at logilab-astng's
> source. Is pylint not compatible with py3k? It says any Python version
>>= 2.5...

logilab-astng should work on Python 3
(http://hg.logilab.org/logilab/astng/file/711e69e4d80e/README.Python3),
but I guess that call to file() got overlooked. It should be replaced
with open().

2to3 doesn't automatically convert file to open - probably because
file is a fairly popular name, and using open has been recommended for
years now.

Thomas
Andrew Berg | 14 Feb 01:33 2012
Picon

Re: Can't run pylint, astng returns NameError

On 2/13/2012 6:24 PM, Thomas Kluyver wrote:
> logilab-astng should work on Python 3
> (http://hg.logilab.org/logilab/astng/file/711e69e4d80e/README.Python3),
> but I guess that call to file() got overlooked. It should be replaced
> with open().
That works. Thanks.
Sylvain Thénault | 14 Feb 09:10 2012
Picon

Re: Can't run pylint, astng returns NameError

On 13 février 18:33, Andrew Berg wrote:
> On 2/13/2012 6:24 PM, Thomas Kluyver wrote:
> > logilab-astng should work on Python 3
> > (http://hg.logilab.org/logilab/astng/file/711e69e4d80e/README.Python3),
> > but I guess that call to file() got overlooked. It should be replaced
> > with open().
> That works. Thanks.

I've encountered that bug and fixed it in the repository some
time ago. Fix will be included in the next astng release.

--

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (09.54.03.55.76)
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 <at> lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects
Thomas Kluyver | 14 Feb 11:28 2012
Picon

Re: Can't run pylint, astng returns NameError

On 14 February 2012 08:10, Sylvain Thénault <sylvain.thenault <at> logilab.fr> wrote:
> I've encountered that bug and fixed it in the repository some
> time ago. Fix will be included in the next astng release.

Thanks Sylvain. Can you just check that you committed the fix, because
the tip of the public repository still has file() there:
http://hg.logilab.org/logilab/astng/file/711e69e4d80e/scoped_nodes.py#l249

Best wishes,
Thomas
Sylvain Thénault | 14 Feb 11:39 2012
Picon

Re: Can't run pylint, astng returns NameError

On 14 février 10:28, Thomas Kluyver wrote:
> On 14 February 2012 08:10, Sylvain Thénault <sylvain.thenault <at> logilab.fr> wrote:
> > I've encountered that bug and fixed it in the repository some
> > time ago. Fix will be included in the next astng release.
> 
> Thanks Sylvain. Can you just check that you committed the fix, because
> the tip of the public repository still has file() there:
> http://hg.logilab.org/logilab/astng/file/711e69e4d80e/scoped_nodes.py#l249

I've erroneously done the fix in the default branch. Should now be
both in #stable and #default tip
--

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (09.54.03.55.76)
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 <at> lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects
Pablo.Karlsson | 5 Mar 13:23 2012
Picon

Re: Can't run pylint, astng returns NameError

It is still in the repo. Encountered it just now. Just so you know
Sylvain Thénault | 12 Mar 11:59 2012
Picon

Re: Can't run pylint, astng returns NameError

On 05 mars 12:23, Pablo.Karlsson wrote:
> It is still in the repo. Encountered it just now. Just so you know

Though 965:0272006bdfbe *is* in the repo, and has been backported to
stable branch. Did you run setup.py install against the repo tip ?

--

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (09.54.03.55.76)
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 <at> lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Gmane