You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(shell): decode Windows pipe output with system codepage instead of UTF-8
On Windows, subprocess pipes deliver output in the system's ANSI
codepage (e.g. CP1252, CP437), not UTF-8. The previous chcp 65001
workaround had no effect on pipe output (PEP 528). Use
locale.getpreferredencoding() with errors='replace' to handle
non-ASCII characters like umlauts in usernames.
FixesLinuxfabrik/monitoring-plugins#681
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
45
45
46
46
### Fixed
47
47
48
+
* shell.py: fix `UnicodeDecodeError` on Windows when command output contains non-ASCII characters (e.g. usernames with umlauts) by decoding with the system's ANSI codepage instead of assuming UTF-8
48
49
* base.py: `cu()` now also escapes HTML characters in the error message, not just in the traceback
49
50
* base.py: `cu()` now detects active exceptions via `sys.exc_info()` instead of string-matching the traceback
50
51
* base.py: `get_state()` no longer calls `sys.exit()` on malformed range specs, returns UNKNOWN instead
0 commit comments