-
Notifications
You must be signed in to change notification settings - Fork 812
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
Drop support for EOL Python 2 #732
Conversation
Thanks for the contribution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, this PR is expected to remove the supports for python 2.
I've reverted the changes made by pyupgrade and instead only removed six and Please let me know if you'd like any of the other pyupgrade changes re-applied. |
Thanks for the contribution. LGTM. For now, let's make those necessary changes only. |
@@ -246,7 +244,7 @@ def test_csv_dataset_quotechar(self): | |||
|
|||
with tempfile.NamedTemporaryFile(dir=self.test_dir) as f: | |||
for example in example_data: | |||
f.write(six.b("{}\n".format(",".join(example)))) | |||
f.write("{}\n".format(",".join(example)).encode("latin-1")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the need for encode coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In particular latin-1 vs. UTF-8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the six documentation:
six.b
(data)A “fake” bytes literal. data should always be a normal string literal. ... In Python 3, data is encoded with the latin-1 encoding to bytes.
https://six.readthedocs.io/#six.b
From the six code:
if PY3:
def b(s):
return s.encode("latin-1")
Fixes #725.
Removes six library and upgrades Python syntax.
Also adds
python_requires
tosetup.py
to help pip, and Trove classifiers to show support on PyPI.