Skip to content

feat: [SNOW-2457402] Unify encoding support in SnowCLI#2792

Open
sfc-gh-kolszewski wants to merge 20 commits intomainfrom
ko/SNOW-2457402-unify-encoding-support
Open

feat: [SNOW-2457402] Unify encoding support in SnowCLI#2792
sfc-gh-kolszewski wants to merge 20 commits intomainfrom
ko/SNOW-2457402-unify-encoding-support

Conversation

@sfc-gh-kolszewski
Copy link
Contributor

@sfc-gh-kolszewski sfc-gh-kolszewski commented Feb 27, 2026

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually on MacOS.
  • I've confirmed that my changes are working by executing CLI's commands manually on Windows.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.
  • I've described my changes in the documentation.

Changes description

See https://snowflakecomputing.atlassian.net/browse/SNOW-2683933

This change adds new encoding configuration section with following keys:

  • file_io - which controls the encoding used on file operations (read, write, open). Uses platform default if not set.
  • subprocess - which controls the encoding used on commands run with subprocess. Uses platform default if not set.
  • show_warnings - which controls whether a warning should be displayed if SnowCLI discovers encoding mismatch in the environment. True by default.

Encoding settings are read from the configuration by SecurePath's read_text, write_text and open methods. As such, most places in the code where SecurePath was not used for these purposes were refactored to use SecurePath. I did not apply this change where encoding was already explicitly set as 'utf-8'

The change should be transparent to Unix users. Windows users can expect the warning to be displayed.

@sfc-gh-kolszewski sfc-gh-kolszewski marked this pull request as ready for review March 4, 2026 14:55
@sfc-gh-kolszewski sfc-gh-kolszewski requested a review from a team as a code owner March 4, 2026 14:55
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.

1 participant