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 raised on Py 3.11+ #950

Closed
freakboy3742 opened this issue Oct 3, 2023 · 1 comment · Fixed by #951
Closed

EncodingWarning raised on Py 3.11+ #950

freakboy3742 opened this issue Oct 3, 2023 · 1 comment · Fixed by #951

Comments

@freakboy3742
Copy link

Python 3.10 introduced the -X warn_default_encoding option as part of PEP597. This option issues an EncodingWarning when a locale-specific default is encoding is used when opening files. This is a useful option to turn on (especially in test suites) if you interact with user-supplied files.

Python 3.11 modified setuptools.run() to make an encoding argument required if subprocess.run() is invoked in text mode. As of 8.0.3, setuptools_scm doesn't provide an encoding argument when invoking run, although there are other environmental hints that UTF-8 encoding should be used.

We encountered this in a test suite because we have -X warn_default_encoding enabled, and we also run pytest in "warnings-as-errors" mode. See [beeware/briefcase#1474] for the way this manifests.

@RonnyPfannschmidt
Copy link
Contributor

thanks for the note, i'll add that flag here as well, its so much better to have enabled

RonnyPfannschmidt added a commit to RonnyPfannschmidt/setuptools_scm that referenced this issue Oct 3, 2023
@RonnyPfannschmidt RonnyPfannschmidt linked a pull request Oct 3, 2023 that will close this issue
RonnyPfannschmidt added a commit that referenced this issue Oct 10, 2023
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.

2 participants