Jean-Michel Fauth <wxjmfa...@gmail.com> added the comment: When I was preparing some test examples to be submitted here. I noticed the module codeop.py used by the InteractiveInterpreter, does not like byte strings very much.
IDLE, Python 3.0.1, winxp sp2 >>> source = b'print(999)' >>> compile(source, '<in>', 'exec') <code object <module> at 0x00AA5CC8, file "<in>", line 1> >>> r = compile(source, '<in>', 'exec') >>> exec(r) 999 >>> from code import InteractiveInterpreter >>> ii = InteractiveInterpreter() >>> ii.runsource(source) Traceback (most recent call last): File "<pyshell#6>", line 1, in <module> ii.runsource(source) File "C:\Python30\lib\code.py", line 63, in runsource code = self.compile(source, filename, symbol) File "C:\Python30\lib\codeop.py", line 168, in __call__ return _maybe_compile(self.compiler, source, filename, symbol) File "C:\Python30\lib\codeop.py", line 70, in _maybe_compile for line in source.split("\n"): TypeError: Type str doesn't support the buffer API >>> >>> source = 'print(999)' >>> ii.runsource(source) 999 False ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4626> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com