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

Cleanup some encoding warnings #3246

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Cleanup some encoding warnings #3246

merged 1 commit into from
Apr 10, 2024

Conversation

danyeaw
Copy link
Member

@danyeaw danyeaw commented Apr 9, 2024

Fixes a few encoding warnings recently introduced in the tests. There is a ruff rule for this called PLW1514, but it is only available if preview rules are enabled.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the python Pull requests that update Python code label Apr 9, 2024
@danyeaw danyeaw requested a review from amolenaar April 9, 2024 02:07
@danyeaw danyeaw added chore Maintenance related PR and removed python Pull requests that update Python code labels Apr 9, 2024
@amolenaar
Copy link
Member

Is there a reason not to enable the --preview flag?

With this check in place, do we still need PYTHONWARNDEFAULTENCODING=true in our build script(s)?

@danyeaw
Copy link
Member Author

danyeaw commented Apr 9, 2024

Hi @amolenaar, I was initially turned off to it since it sounds like enabling beta portions of Ruff. But I agree, let's give it a try. I'll update the PR. Thanks!

@danyeaw
Copy link
Member Author

danyeaw commented Apr 9, 2024

@amolenaar I set preview to true and added PLW1514. Unfortunately, it wasn't detecting even straightforward issues like an open() with no encoding.

@amolenaar
Copy link
Member

Then, let's merge this. It's a nice fix for sure.

@amolenaar amolenaar merged commit f01467a into main Apr 10, 2024
19 checks passed
@amolenaar amolenaar deleted the fix-encoding-warnings branch April 10, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance related PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants