Author perilbrain
Recipients Bruce.Sherwood, THRlWiTi, bsherwood, perilbrain, roger.serwy, terry.reedy
Date 2016-11-03.03:11:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478142700.47.0.742146859721.issue19042@psf.upfronthosting.co.za>
In-reply-to
Content
I have signed the CA. Meantime a came across one more problem in function tabnanny(encoding issue) so I am attaching the new version of ScriptBinding.py.

Summary:-

    def tabnanny(self, source, encoding = None):
        # XXX: tabnanny should work on binary files as well
        #print(encoding)
        f = io.StringIO(source.decode(encoding) if encoding else source)

def source_from_file(self, filename):
        with open(filename, 'rb') as f:
            source = f.read()
            encoding = tokenize.detect_encoding(f.readline)[0]
        ....
        return source, encoding

def _run_module_event(self, event):
        ...
        if not filename:
            self.no_save = True
            source = self.source_from_editor()
            filename = self.editwin.top.wm_title()
        else:
            source, encoding = self.source_from_file(filename)
            self.no_save = False
        code = self.checksyntax(source, filename)
        if not code:
            return 'break'
        if not self.tabnanny(source, encoding):
            return 'break'
        ....
History
Date User Action Args
2016-11-03 03:11:42perilbrainsetrecipients: + perilbrain, terry.reedy, bsherwood, roger.serwy, THRlWiTi, Bruce.Sherwood
2016-11-03 03:11:40perilbrainsetmessageid: <1478142700.47.0.742146859721.issue19042@psf.upfronthosting.co.za>
2016-11-03 03:11:40perilbrainlinkissue19042 messages
2016-11-03 03:11:40perilbraincreate