[Bug] Specify utf-8 encoding in version.py #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the recent update to
setuptools==70.0.0
, the module can no longer be installed in certain python environments. This is due to theversion.py
script not providing any output (get_git_version()
returnsNone
).setuptools
versions prior tosetuptools==66.0.0
fell back topackaging.version.LegacyVersion
, which would provide a PEP440 compliant version number if one wasn't provided. This was removed insetuptools==66
.This PR adds
encoding='utf-8'
to thePopen
command inversion.py
, which putsstderr
andstdout
into text mode, returning a string rather than returning a bytestream when read. This prevents aTypeError
being raised when.strip()
is called on this output (the Exception - indeed, as with all exceptions - is silently caught by the try-except block).Tested locally.