Skip to content

Fix auditpol backup CSV encoding for localized Windows#68935

Open
twangboy wants to merge 2 commits intosaltstack:3006.xfrom
twangboy:fix/68354/3006.x
Open

Fix auditpol backup CSV encoding for localized Windows#68935
twangboy wants to merge 2 commits intosaltstack:3006.xfrom
twangboy:fix/68354/3006.x

Conversation

@twangboy
Copy link
Copy Markdown
Contributor

What does this PR do?

Read auditpol /backup output with locale.getencoding() (Python 3.11+) or mbcs fallback so CSV is decoded with the system ANSI encoding instead of fopen's default UTF-8. Prevents UnicodeDecodeError when lgpo.get runs on non-English Windows (e.g. German).

What issues does this PR fix or reference?

Fixes #68354

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

Read auditpol /backup output with locale.getencoding() (Python 3.11+)
or mbcs fallback so CSV is decoded with the system ANSI encoding
instead of fopen's default UTF-8. Prevents UnicodeDecodeError when
lgpo.get runs on non-English Windows (e.g. German).

Fixes saltstack#68354
@twangboy twangboy requested a review from a team as a code owner April 13, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant