Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EncodingWarning #68

Closed
henryiii opened this issue Sep 6, 2023 · 0 comments · Fixed by #136
Closed

EncodingWarning #68

henryiii opened this issue Sep 6, 2023 · 0 comments · Fixed by #136

Comments

@henryiii
Copy link

henryiii commented Sep 6, 2023

  • bump-my-version version: 0.10
  • Python version: 3.11
  • Operating System: macOS

Description

If you run bump-my-version in an environment with PYTHONWARNDEFAULTENCODING set, it produces warnings (I have it set in a tox.ini). It would be nice if these three locations could define an encoding to avoid the warning. (And I expect the tomlkit one is wrong as is - TOML is always in utf-8, while Python < 3.14 will use "native").

What I Did

Warning when running with the above setting:

/Users/henryschreiner/git/software/build/.tox/bump/lib/python3.11/site-packages/bumpversion/config.py:272: EncodingWarning: 'encoding' argument not specified
  (cfg_file for cfg_file in search_paths if cfg_file.exists() and "bumpversion]" in cfg_file.read_text()),
/Users/henryschreiner/git/software/build/.tox/bump/lib/python3.11/site-packages/bumpversion/config.py:380: EncodingWarning: 'encoding' argument not specified
  toml_data = tomlkit.parse(file_path.read_text()).unwrap()
/Users/henryschreiner/git/software/build/.tox/bump/lib/python3.11/site-packages/bumpversion/scm.py:244: EncodingWarning: 'encoding' argument not specified.
  result = subprocess.run(git_cmd, text=True, check=True, capture_output=True)  # noqa: S603
coordt added a commit that referenced this issue Feb 10, 2024
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 a pull request may close this issue.

1 participant