[issue4626] compile() doesn't ignore the source encoding when a string is passed in

Brett Cannon report at bugs.python.org
Wed Mar 25 00:40:14 CET 2009


Brett Cannon <brett at python.org> added the comment:

On Tue, Mar 24, 2009 at 09:24, Jean-Michel Fauth <report at bugs.python.org>wrote:

>
> Jean-Michel Fauth <wxjmfauth at gmail.com> added the comment:
>
> I'm glad to have discovered this topic. I bumped into something similar
> when I toyed with an interactive interpreter.
>
> from code import InteractiveInterpreter
>
> ii = InteractiveInterpreter()
> source = ...
> ii.runsource(source)
>
> What should be the encoding and/or the type (str, bytes) of the "source"
> string?

Off the top of my head it should be UTF-8. Otherwise it can probably be
bytes as long as it has universal newlines.

----------
Added file: http://bugs.python.org/file13411/unnamed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4626>
_______________________________________
-------------- next part --------------
<br><br><div class="gmail_quote">On Tue, Mar 24, 2009 at 09:24, Jean-Michel Fauth <span dir="ltr">&lt;<a href="mailto:report at bugs.python.org">report at bugs.python.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br>
Jean-Michel Fauth &lt;<a href="mailto:wxjmfauth at gmail.com">wxjmfauth at gmail.com</a>&gt; added the comment:<br>
<br>
I&#39;m glad to have discovered this topic. I bumped into something similar<br>
when I toyed with an interactive interpreter.<br>
<br>
from code import InteractiveInterpreter<br>
<br>
ii = InteractiveInterpreter()<br>
source = ...<br>
ii.runsource(source)<br>
<br>
What should be the encoding and/or the type (str, bytes) of the &quot;source&quot;<br>
string?</blockquote><div><br>Off the top of my head it should be UTF-8. Otherwise it can probably be bytes as long as it has universal newlines.<br></div></div><br>


More information about the Python-bugs-list mailing list