Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-120057: Add os.environ.refresh() method#120059

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 13 commits intopython:mainfromvstinner:env_refresh
Jun 10, 2024

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commentedJun 4, 2024
edited by github-actionsbot
Loading

@vstinner
Copy link
MemberAuthor

I rebased the PR to fix a merge conflict.

I addressed@eryksun's and@JelleZijlstra's reviews: thanks!

@vstinner
Copy link
MemberAuthor

@serhiy-storchaka@erlend-aasland: Would you mind to review this change?

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

What aboutos.environb.refresh()? Does it exist? Does it work?

@vstinner
Copy link
MemberAuthor

@serhiy-storchaka: I addressed your review. Would you mind to review my updated PR?

What about os.environb.refresh()? Does it exist? Does it work?

I added a test on os.environb.refresh(). Yes, it works as expected :-)

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Shouldos.environb.refresh() be documented? We perhaps do not want to attract too much attention to it, as its effect is the same as ofos.environ.refresh().

Test: use directly os.putenv().
@vstinner
Copy link
MemberAuthor

Should os.environb.refresh() be documented? We perhaps do not want to attract too much attention to it, as its effect is the same as of os.environ.refresh().

Hum, I prefer to not document it athttps://docs.python.org/dev/library/os.html#os.environb :-)

@vstinner
Copy link
MemberAuthor

(Ooops, I closed on [Close] instead of [Comment], sorry.)

* Test os.unsetenv()* Document os.unsetenv()* Minor refactoring
@vstinner
Copy link
MemberAuthor

@serhiy-storchaka: PR updated for os.unsetenv().

Oh, I didn't know that Python has two functions (putenv, unsetenv) which modify directly the environment without updatingos.environ.

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM.

@vstinnervstinnerenabled auto-merge (squash)June 10, 2024 16:08
@vstinnervstinner merged commit7aff2de intopython:mainJun 10, 2024
@vstinnervstinner deleted the env_refresh branchJune 10, 2024 16:34
to the environment made after this time are not reflected in:data:`os.environ`,
except for changes made by modifying:data:`os.environ` directly.

The:meth:`!os.environ.refresh()` method updates:data:`os.environ` with
Copy link
Contributor

Choose a reason for hiding this comment

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

FTR, the:meth: and:func: roles will implicitly add parentheses in the rendered output; you do not need to add them explicitly.

vstinner reacted with thumbs up emoji
vstinner added a commit to vstinner/cpython that referenced this pull requestJun 20, 2024
…)"This reverts commit7aff2de.The function is controversial and it was decided to remove it.
mrahtz pushed a commit to mrahtz/cpython that referenced this pull requestJun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull requestJul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull requestJul 17, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra left review comments

@eryksuneryksuneryksun left review comments

@picnixzpicnixzpicnixz left review comments

@erlend-aaslanderlend-aaslanderlend-aasland left review comments

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@vstinner@JelleZijlstra@eryksun@serhiy-storchaka@picnixz@erlend-aasland

[8]ページ先頭

©2009-2025 Movatter.jp