-
-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop reencoding URL when calling with_port() (#623)
* Stop reencoding URL when calling with_port() * Added change note * Fixing CHANGES/623.bugfix.rst code formatting. Co-authored-by: Sviatoslav Sydorenko <[email protected]> Co-authored-by: Elcio Nakashima <[email protected]> Co-authored-by: Sviatoslav Sydorenko <[email protected]>
- Loading branch information
1 parent
51502dd
commit 8f77d3b
Showing
3 changed files
with
7 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Changed call in ``with_port()`` to stop reencoding parts of the URL that were already encoded. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,6 +202,11 @@ def test_with_port_keeps_query_and_fragment(): | |
assert str(url.with_port(8888)) == "http://example.com:8888/?a=1#frag" | ||
|
||
|
||
def test_with_port_percent_encoded(): | ||
url = URL("http://user%name:pass%[email protected]/") | ||
assert str(url.with_port(808)) == "http://user%25name:pass%[email protected]:808/" | ||
|
||
|
||
def test_with_port_for_relative_url(): | ||
with pytest.raises(ValueError): | ||
URL("path/to").with_port(1234) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters