[Python-apps-team] Bug#598482: pylint: Pylint crashes when redirecting output containing non-ascii characters

Jérémy Carrion jeremy.carrion at gmail.com
Wed Sep 29 11:13:10 UTC 2010


Package: pylint
Version: 0.21.1-1
Severity: normal
Tags: upstream


$ cat test.py
#-*-coding:iso-8859-1-*-
class test:
   def __init__ (self,dir) :
       testString = u"répertoire :\n%s !"%dir

$ pylint -f parseable test.py > test.txt
No config file found, using default configuration
Traceback (most recent call last):
  File "/usr/bin/pylint", line 4, in <module>
    lint.Run(sys.argv[1:])
  File "/usr/lib/pymodules/python2.6/pylint/lint.py", line 856, in __init__
    linter.check(args)
  File "/usr/lib/pymodules/python2.6/pylint/lint.py", line 488, in check
    self.check_astng_module(astng, walker, rawcheckers)
  File "/usr/lib/pymodules/python2.6/pylint/lint.py", line 563, in
check_astng_module
    walker.walk(astng)
  File "/usr/lib/pymodules/python2.6/pylint/utils.py", line 516, in walk
    self.walk(child)
  File "/usr/lib/pymodules/python2.6/pylint/utils.py", line 516, in walk
    self.walk(child)
  File "/usr/lib/pymodules/python2.6/pylint/utils.py", line 516, in walk
    self.walk(child)
  File "/usr/lib/pymodules/python2.6/pylint/utils.py", line 513, in walk
    cb(astng)
  File "/usr/lib/pymodules/python2.6/pylint/checkers/format.py", line 317, in
visit_default
    self.add_message(msg_def[0], node=node, args=msg_def[1])
  File "/usr/lib/pymodules/python2.6/pylint/checkers/__init__.py", line 92, in
add_message
    self.linter.add_message(msg_id, line, node, args)
  File "/usr/lib/pymodules/python2.6/pylint/utils.py", line 274, in add_message
    self.reporter.add_message(msgid, (path, module, obj, line or 1), msg)
  File "/usr/lib/pymodules/python2.6/pylint/reporters/text.py", line 97, in
add_message
    self.writeln(self.line_format % locals())
  File "/usr/lib/pymodules/python2.6/pylint/reporters/__init__.py", line 55, in
writeln
    print >> self.out, string
UnicodeEncodeError: 'ascii' codec can't encode characters in position 86-87:
ordinal not in range(128)

when I remove encoding specification at the beginning of the file, the problem
vanishes but I get PyLint error relative to PEP263 (non ascii characters and no
encoding specification).



-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pylint depends on:
ii  python                        2.6.5-5    An interactive high-level object-o
ii  python-logilab-astng          0.20.1-1   rebuild a new abstract syntax tree
ii  python-logilab-common         0.50.3-1   useful miscellaneous modules used
ii  python-support                1.0.8      automated rebuilding support for P

Versions of packages pylint recommends:
ii  python-tk                     2.6.5-1    Tkinter - Writing Tk applications

pylint suggests no packages.

-- no debconf information





More information about the Python-apps-team mailing list