<div dir="ltr">I answered (B) in the tracker.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 20, 2019 at 12:32 PM Pavel Koneski <<a href="mailto:pavel.koneski@gmail.com">pavel.koneski@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
The following issue arose when implementing IronPython 3. Normally the<br>
behavior of CPython is authoritative, but in this case I started having<br>
doubts.<br>
<br>
Since Python 3.2, input in 'exec' mode  of 'compile' does not have to<br>
end in a newline anymore. However, it creates a surprising behavior when<br>
a 'SyntaxError' is reported:<br>
<br>
>>> try: compile('try', '<string>', 'exec')<br>
... except SyntaxError as ex: print(repr(ex))<br>
...<br>
SyntaxError('invalid syntax', ('<string>', 1, 4, 'try\n'))<br>
<br>
The 'text' field of the exception thrown contains an additional newline<br>
character that was not present in the input. Is it:<br>
<br>
a. Proper Python language behavior?<br>
b. CPython implementation artifact?<br>
c. A bug?<br>
<br>
The comments on bpo (<a href="https://bugs.python.org/issue36919" rel="noreferrer" target="_blank">https://bugs.python.org/issue36919</a>) suggest Case B,<br>
but inconclusive. If case B it is, since IronPython does not exhibit<br>
this behavior, I will submit a patch to StdLib test(s) to make them<br>
implementation independent.<br>
<br>
Thanks for comments,<br>
Pavel<br>
<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/guido%40python.org</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div><div><i style="font-family:Arial,Helvetica,sans-serif;font-size:small;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);color:rgb(136,136,136)"><span>Pronouns</span>: he/him/his </i><a href="http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/" style="color:rgb(17,85,204);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)" target="_blank"><i>(why is my <span>pronoun</span> here?)</i></a></div></div></div>