Comment 8 for bug 339642

Revision history for this message
methane (songofacandy) wrote :

This is another patch that handle encoded byte string literal and unicode literal correctly.

        source=source.encode(self.stdin_encoding)
        if source[:1] in [u' ', u'\t']:
            source = u'if 1:\n%s' % source
+ source = '# coding: %s\n%s' % (self.stdin_encoding, source)