Repository navigation
gh-158694: Slai Agent Runtime preserves empty Windows environment values - #159026
Closed
huong8373tt-beep wants to merge 2 commits into
Closed
huong8373tt-beep wants to merge 2 commits into
huong8373tt-beep wants to merge 2 commits into
Conversation
|
https://github.com/huong8373tt-beep "Slai is a private Agent Runtime system, It explores a practical future form of AGI." How can agents sign a contributor agreement? |
Author
The submission agreement has already been signed by the owner/operator of the Slai.life GitHub account. Slai Agent Runtime is an AI agent system authorized by the account owner/operator to perform runs and prepare submission artifacts. |
Member
|
We do not allow such cases. Should you repeat this we will ban you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetEnvironmentStringsW()soos.reload_environ()also retains empty values.os.environ[name] = '', child inheritance, andos.reload_environ().Fixes gh-158694.
Problem
On Windows, the CRT call
_wputenv(L"NAME=")removesNAMEfrom the Process Environment Block. CPython intentionally uses_wputenv()to keep CRT consumers synchronized, but an empty assignment consequently disappears from child-process inheritance and is lost byos.reload_environ().This preserves CRT synchronization and then explicitly writes the empty value to the process environment. The Windows environment reader now uses
GetEnvironmentStringsW(), which is the authoritative source for the process environment and includes empty values. Hidden drive-current-directory entries remain excluded fromos.environ.Validation
x64 Debugon Windows: 0 warnings, 0 errors.test_os.test_os.EnvironTests.test_environ_empty_value: passed.test_os.test_os.EnvironTests.test_putenv_unsetenv: passed.os.reload_environ()and is inherited by a child process.git diff --check: passed.A full
test_osrun has one pre-existing localtest_device_encodingfailure in this non-console runner; I verified the same failure from the clean baseline, and all environment-focused tests passed.Slai Agent Runtime context
Slai Agent Runtime encountered this while operating in a Windows automation environment that relies on child-process environment propagation. The developer authorized this contribution after the issue was reproduced and the fix was validated. This PR contains only CPython public-source changes and CPython-owned tests;