Skip to content
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

bpo-39395: os.putenv() is now always available #18135

Merged
merged 1 commit into from Jan 24, 2020

Conversation

@vstinner
Copy link
Member

vstinner commented Jan 23, 2020

On non-Windows platforms, Python now requires setenv() to build.

https://bugs.python.org/issue39395

@vstinner

This comment has been minimized.

Copy link
Member Author

vstinner commented Jan 23, 2020

If this PR is merged, I plan to also require unsetenv() to build and always make os.unsetenv() available, once https://bugs.python.org/issue39413 will be fixed.

@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Jan 23, 2020

🤖 New build scheduled with the buildbot fleet by @vstinner for commit d499e9a 🤖

If you want to schedule another build, you need to add the "🔨 test-with-buildbots" label again.

@vstinner

This comment has been minimized.

Copy link
Member Author

vstinner commented Jan 23, 2020

The PR built successfully on all tested buildbots: Linux (Ubuntu, Fedora, RHEL7, RHEL8, Gentoo, Arch Linux, ...), Windows (7, 8.1, 10, ...), macOS, FreeBSD.

I checked the 3 buildbot failures: they are unrelated.

@vstinner

This comment has been minimized.

Copy link
Member Author

vstinner commented Jan 24, 2020

Hum, I think I will wait until my PR #18163 is merged, so I can also require os.unsetenv() to be available in this PR.

The os.putenv() and os.unsetenv() functions are now always available.

On non-Windows platforms, Python now requires setenv() and unsetenv()
functions to build.

Remove putenv_dict from posixmodule.c: it's not longer needed.
@vstinner vstinner force-pushed the vstinner:requires_setenv branch from d499e9a to feddf6d Jan 24, 2020
@vstinner

This comment has been minimized.

Copy link
Member Author

vstinner commented Jan 24, 2020

I merged my PR #18163 so os.unsetenv() is now also available on Windows. I updated my PR to also require unsetenv() to build Python.

setenv() and unsetenv() should be available on all platforms supported by Python. If it's not the case, someone can maintain a downstream patch which is a revert of this PR.

Or we can revisit the idea of unsetting variables set by Python at exit, to workaround putenv() issue: https://bugs.python.org/issue39395

@vstinner

This comment has been minimized.

Copy link
Member Author

vstinner commented Jan 24, 2020

Or we can revisit the idea of unsetting variables set by Python at exit, to workaround putenv() issue: https://bugs.python.org/issue39395

I'm talking about something this PR #18078 that I just closed. But only if someone asks to support a platform which doesn't provide setenv() and unsetenv().

@vstinner vstinner merged commit b8d1262 into python:master Jan 24, 2020
9 checks passed
9 checks passed
Docs
Details
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
Azure Pipelines PR #20200124.30 succeeded
Details
bedevere/issue-number Issue number 39395 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vstinner vstinner deleted the vstinner:requires_setenv branch Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.