Menu

#295 Internal error when parsing assignment to a slice of a list

0.8.19
open
nobody
None
5
2011-05-31
2011-05-31
No

This is Debian bug #627449 (http://bugs.debian.org/627449). Here's what the bug report says:

pychecker Version 0.8.19 crashes with an "INTERNAL ERROR" if it encounters a python statements where an assignment to a slice of a list is done. The following piece of code provokes the error:

def function():
l = []
l[0:0] = (1,)

Here is an example:

/bin/echo -e "def function():\n l = []\n l[0:0] = (1,)\n" > pychecker_failure.py
pychecker pychecker_failure.py
---
Processing module pychecker_failure (pychecker_failure.py)...

Warnings...

pychecker_failure.py:3: INTERNAL ERROR -- STOPPED PROCESSING FUNCTION --
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/pychecker/warn.py", line 242, in _checkFunction
_checkCode(code, codeSource)
File "/usr/lib/pymodules/python2.6/pychecker/warn.py", line 155, in _checkCode
raise NotImplementedError('No DISPATCH member for op %r' % op)
NotImplementedError: No DISPATCH member for op 43
---

This is severe bug since pychecker recursively checks module dependencies. If you have a few slice assignments in one module of a big project, you cannot any longer use pychecker on any python file of the whole project.

Discussion


Log in to post a comment.