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

[Bug] Specify utf-8 encoding in version.py #8

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

nashsibanda
Copy link

@nashsibanda nashsibanda commented Jul 24, 2024

With the recent update to setuptools==70.0.0, the module can no longer be installed in certain python environments. This is due to the version.py script not providing any output (get_git_version() returns None). setuptools versions prior to setuptools==66.0.0 fell back to packaging.version.LegacyVersion, which would provide a PEP440 compliant version number if one wasn't provided. This was removed in setuptools==66.

This PR adds encoding='utf-8' to the Popen command in version.py, which puts stderr and stdout into text mode, returning a string rather than returning a bytestream when read. This prevents a TypeError 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.

@nashsibanda nashsibanda changed the title Specify utf-8 encoding in Popen [Bug] Specify utf-8 encoding in version.py Jul 24, 2024
@nashsibanda nashsibanda merged commit 2bc0068 into master Jul 24, 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 this pull request may close these issues.

2 participants