Fix URL parsing with Python 3.8.1 and 2.7.15#409
Fix URL parsing with Python 3.8.1 and 2.7.15#409onovy wants to merge 1 commit intoaio-libs:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #409 +/- ##
=======================================
Coverage 99.24% 99.24%
=======================================
Files 2 2
Lines 664 664
Branches 152 152
=======================================
Hits 659 659
Misses 5 5Continue to review full report at Codecov.
|
|
Are you sure this is OK? |
|
I deleted my last comment as it was incorrect According to https://bugs.python.org/issue27657, they have reverted the fix in 3.8.2 and 3.7.7 as it was causing unexpected behavior changes in a minor release. So the patch should look more like the following if I understand well: --- a/tests/test_url_parsing.py
+++ b/tests/test_url_parsing.py
@@ -40,9 +40,15 @@ class TestScheme:
def test_no_scheme1(self):
u = URL("google.com:80")
- assert u.scheme == ""
- assert u.host is None
- assert u.path == "google.com:80"
+ # See: https://bugs.python.org/issue27657
+ if sys.version_info[:3] == (3, 7, 6) or sys.version_info[:3] == (3, 8, 1) or sys.version_info >= (3, 9, 0):
+ assert u.scheme == "google.com"
+ assert u.host is None
+ assert u.path == "80"
+ else:
+ assert u.scheme == ""
+ assert u.host is None
+ assert u.path == "google.com:80"
assert u.query_string == ""
assert u.fragment == "" |
yes, I was sure it was right. Change in Python was reverted after this PR. I checked your patch and looks correct. Updated this PR to reflect that. Thanks. |
|
Thanks |
|
Merged manually by 3d5bf8f |
What do these changes do?
URL parsing has been changed in newer Python releases, see: https://bugs.python.org/issue27657
Are there changes in behavior for the user?
No, just test fix.
Related issue number
None.
Checklist
CHANGESfolder<issue_id>.<type>(e.g.588.bugfix)issue_idchange it to the pr id after creating the PR.feature: Signifying a new feature..bugfix: Signifying a bug fix..doc: Signifying a documentation improvement..removal: Signifying a deprecation or removal of public API..misc: A ticket has been closed, but it is not of interest to users.Fix issue with non-ascii contents in doctest text files.