(PUP-11348) Use ENV directly on Windows #9052
Merged
+123
−217
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.
Ruby 3 no longer uses the current code page when getting and setting environment variables. Instead it always calls wide functions like
GetEnvironmentVariableW
and transcodes the value fromUTF-16LE
toUTF-8
. And it does the reverse when setting environment variables. As a result, we don't need our Windows specific code for accessing environment variables.Puppet::Util.{get_env,get_environment,clear_environment,set_env,merge_environment}
ENV
related methods directlyTested Windows (x86, x64 and Japanese) in https://jenkins-platform.delivery.puppetlabs.net/view/puppet-agent/view/ad-hoc/job/platform_puppet-agent-extra_puppet-agent-integration-suite_adhoc-ad_hoc/1103/