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.

Author terry.reedy
Recipients Paul.Bonser, armicron, benjamin.peterson, georg.brandl, kbk, loewis, meador.inge, roger.serwy, serhiy.storchaka, terry.reedy
Date 2013-09-07.23:09:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1378595385.78.0.735567012714.issue18873@psf.upfronthosting.co.za>
In-reply-to
Content
Nasty bug. Running a file with 'coding=0', a quite legitimate assignment statement, causes Idle to close, with LookupError, leading to SyntaxError, reported on the console if there is one ('crash' otherwise). (Idle closing is a separate problem, with an issue, from the misinterpretation of 'coding'.)

Loading such a file works with a warning that should not be there.

Adding # leads to "SyntaxError: unknown encoding" in a message box, without closing Idle. I presume this is to be expected and is proper. There is also a warning on loading.

The code patch adds '^[ \t\f]' to the re. \f = FormFeed? Should that really be there? The PEP patch instead adds '^[ \t\v]', \v= VerticalTab? Same question, and why the difference?

Your other changes to IOBinding.coding_spec look correct and fix a couple of bugs in the function (searching all lines for the coding cookie, mangling a line without a line end).

Someone else should review the other code changes.
History
Date User Action Args
2013-09-07 23:09:45terry.reedysetrecipients: + terry.reedy, loewis, georg.brandl, kbk, benjamin.peterson, roger.serwy, meador.inge, serhiy.storchaka, Paul.Bonser, armicron
2013-09-07 23:09:45terry.reedysetmessageid: <1378595385.78.0.735567012714.issue18873@psf.upfronthosting.co.za>
2013-09-07 23:09:45terry.reedylinkissue18873 messages
2013-09-07 23:09:45terry.reedycreate