Skip to content

Commit

Permalink
Fix #170: Dont encode empty netloc
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Feb 17, 2018
1 parent e433b3b commit cf2876d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGES
=======

1.1.1 (2018-02-17)
------------------

* Fix performance regression: don't encode enmpty netloc (#170)

1.1.0 (2018-01-21)
------------------

Expand Down
7 changes: 5 additions & 2 deletions yarl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,11 @@ def build(cls, *, scheme='', user='', password='', host='', port=None,
raise ValueError(
"Only one of \"query\" or \"query_string\" should be passed")

netloc = cls._make_netloc(user, password, host, port,
encode=not encoded)
if not user and not password and not host and not port:
netloc = ''
else:
netloc = cls._make_netloc(user, password, host, port,
encode=not encoded)
if not encoded:
path = cls._PATH_QUOTER(path)
if netloc:
Expand Down

0 comments on commit cf2876d

Please sign in to comment.