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

Force utf 8 encoding on writes #163

Merged
merged 4 commits into from
Mar 23, 2024
Merged

Conversation

coordt
Copy link
Member

@coordt coordt commented Mar 23, 2024

Fixes #157

The problem was that it failed to write the configuration file because of a character-encoding problem. This forces all writes to use UTF-8.

@coordt coordt linked an issue Mar 23, 2024 that may be closed by this pull request
Copy link

Version hint: patch
Current version: 0.19.2
New version (when merged): 0.19.3

Comment ID: Display the version hint-auto-generated

Copy link

codecov bot commented Mar 23, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 93.44%. Comparing base (2e55fa1) to head (84254e0).
Report is 4 commits behind head on master.

Files Patch % Lines
bumpversion/cli.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #163   +/-   ##
=======================================
  Coverage   93.44%   93.44%           
=======================================
  Files          24       24           
  Lines        1479     1479           
  Branches      295      295           
=======================================
  Hits         1382     1382           
  Misses         68       68           
  Partials       29       29           
Flag Coverage Δ
python-3.10 93.44% <66.66%> (ø)
python-3.11 93.44% <66.66%> (ø)
python-3.8 93.44% <66.66%> (ø)
python-3.9 93.44% <66.66%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Mar 23, 2024

PR Preview Action v1.4.7
🚀 Deployed preview to https://callowayproject.github.io/bump-my-version/pr-preview/pr-163/
on branch gh-pages at 2024-03-23 14:17 UTC

@coordt coordt merged commit b99eb76 into master Mar 23, 2024
13 of 16 checks passed
@coordt coordt deleted the 157-force-utf-8-encoding-on-writes branch March 23, 2024 14:30
@melMass
Copy link

melMass commented Dec 8, 2024

I think it's related to my issue, I get this on bump all of a sudden:

bump-my-version bump minor
Exception in thread Thread-25 (_readerthread):
Traceback (most recent call last):
  File "C:\Users\User\.pyenv\pyenv-win\versions\3.11.3\Lib\threading.py", line 1038, in _bo
otstrap_inner
    self.run()
  File "C:\Users\User\.pyenv\pyenv-win\versions\3.11.3\Lib\threading.py", line 975, in run 
    self._target(*self._args, **self._kwargs)
  File "C:\Users\User\.pyenv\pyenv-win\versions\3.11.3\Lib\subprocess.py", line 1568, in _r
eaderthread
    buffer.append(fh.read())
                  ^^^^^^^^^
  File "C:\Users\User\.pyenv\pyenv-win\versions\3.11.3\Lib\encodings\cp1252.py", line 23, i
n decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 20: character maps t
o <undefined>

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.

pyproject.toml file erased after UnicodeError on WIndows
2 participants