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

chore: eat Python 2 leftovers #3189

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

chore: eat Python 2 leftovers #3189

wants to merge 5 commits into from

Conversation

pajod
Copy link
Contributor

@pajod pajod commented Apr 22, 2024

since 3.3: EnvironmentError, IOError, socket.error and select.error are merged into IOError.
They may now return a more specific subclass - which this commit does not utilize yet.
@pajod pajod changed the title Eat Python 2 leftovers chore: eat Python 2 leftovers Apr 22, 2024
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why removing this line? can't we still have files using latin 1 or other encoding?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the utf-8 comment because it does not do anything. https://peps.python.org/pep-3120/

And if we were to want files in latin-1:

  • Either they are Python sources, then it needlessly complicated to not have them in UTF-8
  • Or they are not, then PEP 263 is unfit to signal that, because editors would at best get that right for Python sources.

Fortunately, the only place we could possibly want that is in tests/requests/valid/*.py.. and there, we never did and should not start now. If you like, I will rewrite the tests to even change affected .http files (example) to unambiguous 7-bit-clean format, e.g. by using\N{Latin Capital Letter A with Diaeresis} escapes.

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.

None yet

2 participants