Skip to content
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

Polish quoting #2668

Merged
merged 5 commits into from
Jan 17, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'master' into quoting
asvetlov committed Jan 17, 2018
commit 58ff86844fcaac2f6c470901510f2bad87142159
10 changes: 6 additions & 4 deletions aiohttp/web_urldispatcher.py
Original file line number Diff line number Diff line change
@@ -343,7 +343,7 @@ def get_info(self):
return {'path': self._path}

def url_for(self):
return URL(self._path, encoded=True)
return URL.build(path=self._path, encoded=True)

def __repr__(self):
name = "'" + self.name + "' " if self.name is not None else ""
@@ -417,7 +417,7 @@ def get_info(self):
def url_for(self, **parts):
url = self._formatter.format_map({k: URL.build(path=v).raw_path
for k, v in parts.items()})
return URL(url)
return URL.build(path=url)

def __repr__(self):
name = "'" + self.name + "' " if self.name is not None else ""
@@ -484,8 +484,10 @@ def url_for(self, *, filename, append_version=None):
while filename.startswith('/'):
filename = filename[1:]
filename = '/' + filename
url = self._prefix + URL.build(path=filename).raw_path
url = URL(url)

# filename is not encoded
url = URL.build(path=self._prefix + filename)

if append_version is True:
try:
if filename.startswith('/'):
You are viewing a condensed version of this merge commit. You can view the full changes here.