Skip to content
Myr

Better support of utf-8 paths.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jérémy Bethmont · committed by Jérémy Bethmont · parent 7dc581f · Browse files · 1 file+6 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−4 removed

  • other:+6 added−4 removed

1 file+6 added−4 removed

modified:requests/models.py+6 added-4 removed
245 unmodified lines
246 def _build_url(self):247 """Build the actual URL to use"""248249 # Support for unicode domain names and paths.250 parsed_url = list(urlparse(self.url))251 parsed_url[1] = parsed_url[1].encode('idna')252 parsed_url[2] = urllib.quote(urllib.unquote(parsed_url[2]))253 self.url = urlunparse(parsed_url)250 scheme, netloc, path, params, query, fragment = urlparse(self.url)251 netloc = netloc.encode('idna')252 if isinstance(path, unicode):253 path = path.encode('utf-8')254 path = urllib.quote(urllib.unquote(path))255 self.url = str(urlunparse([ scheme, netloc, path, params, query, fragment ]))256257 if self._enc_params:258 if urlparse(self.url).query:259 return '%s&%s' % (self.url, self._enc_params)
310 unmodified lines