Skip to content

Add support Python 3.9 #578

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

Merged
merged 7 commits into from
Feb 21, 2024
Merged

Add support Python 3.9 #578

merged 7 commits into from
Feb 21, 2024

Conversation

shadchin
Copy link
Contributor

@shadchin shadchin commented Nov 15, 2020

Fixes #540
Fixes #541
Fixes #474

Rework #544

@sfdye
Copy link
Collaborator

sfdye commented Nov 24, 2020

Looks like travis is still failing

@shadchin
Copy link
Contributor Author

Yes, urlopen_FileTests.* of tests is falling for Python 3.9, but I don't know how to fix it properly :-(

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Mar 17, 2021
@mgorny
Copy link
Contributor

mgorny commented Jun 10, 2021

@shadchin, I think you need to quote non-ASCII characters in URLs, i.e.:

diff --git a/tests/test_future/test_urllib_toplevel.py b/tests/test_future/test_urllib_toplevel.py
index 68bc4c9..923b2e8 100644
--- a/tests/test_future/test_urllib_toplevel.py
+++ b/tests/test_future/test_urllib_toplevel.py
@@ -120,7 +120,7 @@ class urlopen_FileTests(unittest.TestCase):
         finally:
             f.close()
         self.pathname = support.TESTFN
-        self.returned_obj = urlopen("file:%s" % self.pathname)
+        self.returned_obj = urlopen("file:%s" % urllib_parse.quote(self.pathname))
 
     def tearDown(self):
         """Shut down the open object"""
@@ -167,7 +167,7 @@ class urlopen_FileTests(unittest.TestCase):
         self.assertIsInstance(self.returned_obj.info(), email_message.Message)
 
     def test_geturl(self):
-        self.assertEqual(self.returned_obj.geturl(), self.pathname)
+        self.assertEqual(self.returned_obj.geturl(), urllib_parse.quote(self.pathname))
 
     def test_getcode(self):
         self.assertIsNone(self.returned_obj.getcode())

With this change, the tests pass for me.

@edschofield edschofield merged commit 7f494f8 into PythonCharmers:master Feb 21, 2024
@shadchin shadchin deleted the fix_39 branch February 28, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants