Skip to content

[3.8] bpo-39562: Prevent collision of future and compiler flags (GH-19230) #19835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2020

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented May 1, 2020

The constant values of future flags in the future module
is updated in order to prevent collision with compiler flags.
Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing
with CO_FUTURE_DIVISION..
(cherry picked from commit 4454057)

Co-authored-by: Batuhan Taşkaya batuhanosmantaskaya@gmail.com

https://bugs.python.org/issue39562

@pablogsal
Copy link
Member Author

We need to still maybe add a better way to document this? @vstinner Where would you like for the documentation for this change to live?

@vstinner
Copy link
Member

vstinner commented May 1, 2020

We need to still maybe add a better way to document this? @vstinner Where would you like for the documentation for this change to live?

Can you at least backport the NEWS entry?

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if you add the NEWS entry.

I tested manually: this change does fix https://bugs.python.org/issue39562#msg365311

@vstinner
Copy link
Member

vstinner commented May 1, 2020

We need to still maybe add a better way to document this? @vstinner Where would you like for the documentation for this change to live?

One option is to add a "Notable changes in Python 3.8.3" section since the change is backward incompatible. Something like:
https://docs.python.org/dev/whatsnew/3.8.html#notable-changes-in-python-3-8-1

But it's up to you to decide if it's worth it or not. The 3.9 change is documented in What's New in Python 3.9, in the "Porting to Python 3.9" section:
https://docs.python.org/dev/whatsnew/3.9.html#changes-in-the-python-api

@pablogsal
Copy link
Member Author

Oh, seems like @isidentical used the new | operator on dict:

======================================================================
ERROR: test_ensure_flags_dont_clash (test.test_future.FutureTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/python/cpython/Lib/test/test_future.py", line 88, in test_ensure_flags_dont_clash
    flags |= {
TypeError: unsupported operand type(s) for |=: 'dict' and 'dict'
----------------------------------------------------------------------

I will update the PR soon to solve this and with @vstinner suggestions

…onGH-19230)

The constant values of future flags in the __future__ module
is updated in order to prevent collision with compiler flags.
Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing
with CO_FUTURE_DIVISION..
(cherry picked from commit 4454057)

Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
@miss-islington
Copy link
Contributor

@pablogsal: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 5055c27 into python:3.8 May 1, 2020
@pablogsal pablogsal deleted the backport-4454057-3.8 branch May 19, 2021 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants