Message371938
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 |
|
Date |
User |
Action |
Args |
2020-06-20 14:40:43 | scoder | set | recipients:
+ scoder, gvanrossum, vstinner, petr.viktorin, serhiy.storchaka, yselivanov, levkivskyi, ethan smith, miss-islington, masthana, msullivan |
2020-06-20 14:40:43 | scoder | set | messageid: <1592664043.72.0.209284189435.issue35975@roundup.psfhosted.org> |
2020-06-20 14:40:43 | scoder | link | issue35975 messages |
2020-06-20 14:40:43 | scoder | create | |
|