Skip to content

feat: changing codepage - #104

Merged
fdevans merged 3 commits into
rundeck-plugins:mainfrom
taizod1024:issues/103
Aug 3, 2026
Merged

feat: changing codepage#104
fdevans merged 3 commits into
rundeck-plugins:mainfrom
taizod1024:issues/103

Conversation

@taizod1024

@taizod1024 taizod1024 commented Feb 18, 2024

Copy link
Copy Markdown

If the environment variable RD_NODE_CODEPAGE is set, change the codepage.
The implementation method is the same as the RD_NODE_OUTPUT_CHARSET of winrm_exec.py.

seealso: #103 (comment)
file: py-winrm-plugin-2.1.3+104.zip


Maintainer notes:

  • Merged current main into this branch (was 59 commits behind) to bring it up to date.
  • Added validation for RD_NODE_CODEPAGE: value is trimmed and parsed as an int, falling back to the default codepage with a warning logged on invalid input, instead of passing the raw string straight into open_shell(). Also moved DEFAULT_CODEPAGE to a module-level constant.
  • Verified locally (CI does not run on this PR): ./gradlew build passes, the packaged zip contains the updated code, and the full Python unit test suite (26 tests) passes.

@taizod1024 taizod1024 changed the title feat: chainging codepage feat: changing codepage Feb 18, 2024
@taizod1024
taizod1024 marked this pull request as draft June 1, 2024 00:36
@taizod1024
taizod1024 marked this pull request as ready for review June 1, 2024 00:36
@taizod1024

Copy link
Copy Markdown
Author

@fdevans @ltamaster

@fdevans
fdevans requested a review from Copilot March 18, 2026 21:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds support for overriding the WinRM shell codepage via the RD_NODE_CODEPAGE environment variable, aligning behavior with the existing RD_NODE_OUTPUT_CHARSET override pattern used elsewhere in the plugin.

Changes:

  • Introduce a default codepage (65001) and allow override from RD_NODE_CODEPAGE.
  • Pass the selected codepage value into self.protocol.open_shell(...) instead of a hardcoded literal.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread contents/winrm_session.py Outdated
Comment thread contents/winrm_session.py Outdated
Parse the env var as int with a trim, falling back to the default and
logging a warning on invalid input, instead of passing the raw string
through to open_shell(). Also hoists DEFAULT_CODEPAGE out of run_cmd
so it isn't shadowed as a function-local pseudo-constant.
@fdevans
fdevans requested a review from a team August 3, 2026 22:14
@fdevans
fdevans merged commit 46e4aaf into rundeck-plugins:main Aug 3, 2026
1 of 2 checks passed
@fdevans fdevans mentioned this pull request Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants