This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scoder
Recipients ethan smith, gvanrossum, levkivskyi, masthana, miss-islington, msullivan, petr.viktorin, scoder, serhiy.storchaka, vstinner, yselivanov
Date 2020-06-20.14:40:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1592664043.72.0.209284189435.issue35975@roundup.psfhosted.org>
In-reply-to
Content
I was made aware [1] that the addition of the "cf_feature_version" field broke the backwards compatibility of the "PyRun_StringFlags()" function [2]. Unlike what the docs of "PyCompilerFlags" [3] suggest, the new field is not ignored there but must now be set in order to enable the syntax features of the running Python version.

Background: A Cython user was trying "exec()" on code with f-strings in Py3.8 and got a SyntaxError, because "cf_feature_version" had not been initialised.

I can see two types of existing code being affected:

1) applications or modules that execute user provided Python code (as in the bug report) for which users expect the syntax of the currently running Python runtime to be available.

2) code that used to work in Py3.6/7 using the available Python syntax features and now runs into newly introduced syntax restrictions in Py3.8, such as f-strings no longer being available.

Since Py3.8 has been out for a while with this change, and there were apparently little complaints in addition to issue 37072, should we just update the documentation of "PyCompilerFlags" and "PyRun_StringFlags()" to mention the change there?

[1] https://github.com/cython/cython/issues/3695
[2] https://docs.python.org/3/c-api/veryhigh.html#c.PyRun_StringFlags
[3] https://docs.python.org/3/c-api/veryhigh.html#c.PyCompilerFlags
History
Date User Action Args
2020-06-20 14:40:43scodersetrecipients: + scoder, gvanrossum, vstinner, petr.viktorin, serhiy.storchaka, yselivanov, levkivskyi, ethan smith, miss-islington, masthana, msullivan
2020-06-20 14:40:43scodersetmessageid: <1592664043.72.0.209284189435.issue35975@roundup.psfhosted.org>
2020-06-20 14:40:43scoderlinkissue35975 messages
2020-06-20 14:40:43scodercreate