New submission from Brett Cannon <[EMAIL PROTECTED]>: Passing in bytes to compile() works well for letting the parser handle the decoding of a file when an encoding is specified, but it doesn't take care of universal newlines::
>>> source = b'a = 1\r\nb = 2\r\n' >>> compile(source, '<test>', 'exec') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<test>", line 1 a = 1 ^ SyntaxError: invalid syntax ---------- components: Interpreter Core messages: 77596 nosy: brett.cannon severity: normal stage: needs patch status: open title: No universal newline support for compile() when using bytes type: behavior versions: Python 3.0 _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4628> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com