[issue18077] dis.dis throws IndexError

2013-05-28 Thread Elazar Gershuni
Elazar Gershuni added the comment: If you pass 'None' for `path`, then "'NoneType' object has no attribute 'endswith'" is not as nearly as obscure. But if you insist not to fix it, and don't mind to leave another arbitrary inconsistency between python2 and python3 obscured, I have nothing more

[issue18077] dis.dis throws IndexError

2013-05-28 Thread Ronald Oussoren
Ronald Oussoren added the comment: On 28 May, 2013, at 10:28, Elazar Gershuni wrote: > > Elazar Gershuni added the comment: > > Is it standard procedure to raise an unrelated exception in when an invalid > parameter is passed? I did not encounter any other library function that > behaves li

[issue18077] dis.dis throws IndexError

2013-05-28 Thread Elazar Gershuni
Elazar Gershuni added the comment: Is it standard procedure to raise an unrelated exception in when an invalid parameter is passed? I did not encounter any other library function that behaves like this. Especially taking the fact that this is the normal usage in python3. How do I supposed to

[issue18077] dis.dis throws IndexError

2013-05-27 Thread Ronald Oussoren
Ronald Oussoren added the comment: AFAIK dis.dis only decompiles bytecode in python 2, as is mentioned in the documentation at . In Python 3 dis.dis can compile a string with Python source to bytecode and decompile that (see

[issue18077] dis.dis throws IndexError

2013-05-27 Thread Elazar Gershuni
Elazar Gershuni added the comment: it happens that: (code, i) == ('pass', 4) -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue18077] dis.dis throws IndexError

2013-05-27 Thread Elazar Gershuni
New submission from Elazar Gershuni: >>> dis.dis('pass') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/dis.py", line 45, in dis disassemble_string(x) File "/usr/lib/python2.7/dis.py", line 112, in disassemble_string labels = findlabels(code) File