This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE tabnanny check fails
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.6, Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: python-dev, terry.reedy, Сергей Лисов
Priority: normal Keywords:

Created on 2015-08-09 07:51 by Сергей Лисов, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg248314 - (view) Author: Сергей Лисов (Сергей Лисов) Date: 2015-08-09 07:51
idlelib.ScriptBinding line 72: tokenize.TokenError object is not iterable
msg248616 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-08-14 20:43
I think there are two issues here.

1. tabnanny is run on the editor file every time Check Module Alt-X or Run Module F5 is used. However, Tabnanny is only rum after the file has been compiled as syntactically correct.  I don't think that the tokenize module should fail on a file that compiles. Please cut your file to the minimum needed to raise an error.  Then upload the complete traceback.

2. When a TokenError does occur, Idle executes
            except tokenize.TokenError as msg:
                msgtxt, (lineno, start) = msg
This must be the line that failed (the traceback would have said).  It is line 74 in 3.4.3.  (Which version are you using?)  The fix is to add '.args' at the end.
msg248618 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-08-14 21:00
New changeset 724d9b589cfc by Terry Jan Reedy in branch '2.7':
Issue #24833: Add attribute reference needed for 3.x, but optional for 2.7,
https://hg.python.org/cpython/rev/724d9b589cfc

New changeset cce226356477 by Terry Jan Reedy in branch '3.4':
Issue #24833: Add attribute reference needed for 3.x.
https://hg.python.org/cpython/rev/cce226356477
msg248619 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-08-14 21:02
I fixed the Idle part but would really like to see the cause of the tokenize error.
History
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 69021
2016-06-26 21:17:09terry.reedysetstatus: open -> closed
assignee: terry.reedy
resolution: fixed
stage: resolved
2015-08-14 21:02:38terry.reedysettype: behavior
messages: + msg248619
versions: + Python 2.7, Python 3.5, Python 3.6
2015-08-14 21:00:42python-devsetnosy: + python-dev
messages: + msg248618
2015-08-14 20:43:02terry.reedysetnosy: + terry.reedy
messages: + msg248616
2015-08-09 07:51:59Сергей Лисовcreate