-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Add os.reload_environ() function #120057
Comments
Note that on Windows the C runtime's Unicode and multibyte environments -- |
As soon as there are different "caches", it's hard to keep everything in sync and consistent :-( |
I'm not sure if this is a good idea. I suspect it will be a hard feature to get right, and as noted in the forum discussion, most beginners will misunderstand the feature. |
Would you mind to elaborate? |
I added "in the same process" to reduce misunderstanding. |
FYI, there was this issue: #119737 (so you may want to close it to avoid duplicates) |
I closed issue #119737 as a duplicate of this issue. |
Implemented by the commit 7aff2de. |
As I noted in the discourse thread, and was mentioned in the comment on the PR, I still feel like this name will be confusing for new users, even with docs clarifying it. Can we maybe re-discuss this? Or at least choose another name? Should we continue here or in the discourse thread? |
I've elaborated on this concern here: https://discuss.python.org/t/method-to-refresh-os-environ/54774/24 |
…)" This reverts commit 7aff2de. The function is controversial and it was decided to remove it.
Since we had a bunch of closed PRs, should this issue be closed for now? or are there other pending discussions? |
There was other ongoing discussion: https://discuss.python.org/t/bikeshedding-a-method-to-refresh-os-environ/57628/22 I think that @ncoghlan's idea about a module level Somebody need to put a period here. Either reimplement this feature as a module level function, or keep all as is, -- these are two most probable options. |
Python 3.14 alpha 1 was released with |
You tell me; you created the issue :) |
I closed the issue, I'm not the one who reopened it. |
@serhiy-storchaka: What's the status of this issue? |
You should ask @zooba, the author of the discussion. According to the results of the poll, the majority prefers a module level function. Voting is not binding, and not only core developers voted, but this should still be taken into account. I do not see a vote of @zooba. Is he satisfied with proposed variants and what does he propose? |
@zooba: What's the status of this issue? |
I would suggest to close the issue and keep the os.environ.refresh() method. |
I think if reload_environment is preferred by more people we should go with that. |
I posted on the discussion, but the majority liked the module-level function instead of putting it on the object, and I personally think So as much as anyone wants to keep me happy, |
On other hand, it reloads the process environment to the |
I think @zooba's point was that this function doesn't reload the system wide environment variable settings into the running application process, which That misreading doesn't seem particularly likely to me though, and the fact this operation reloads both |
I can't reasonably see Whereas Perhaps |
Replace the os.environ.refresh() method with a new os.reload_environ() function.
I created PR gh-126268 to replace the IMO |
Replace the os.environ.refresh() method with a new os.reload_environ() function. Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Adam Turner <[email protected]>
Done: I merged the PR. I close the issue. |
Feature or enhancement
When the environment is modified outside Python,
os.environ
is not updated. I propose adding a newos.environ.refresh()
method to manually updateos.environ
.Discussion: https://discuss.python.org/t/method-to-refresh-os-environ/54774
Linked PRs
The text was updated successfully, but these errors were encountered: