Skip to content
Myr

super comments!

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 18270e1 · Browse files · 1 file+17 added−2 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+17 added−2 removed

  • other:+17 added−2 removed

1 file+17 added−2 removed

modified:requests/models.py+17 added-2 removed
283 unmodified lines
284 def _build_url(self):285 """Build the actual URL to use."""286287 # Support for unicode domain names and paths.288 scheme, netloc, path, params, query, fragment = urlparse(self.url)288 (scheme, netloc, path, params, query, fragment) = urlparse(self.url)289290 # International Domain Name291 netloc = netloc.encode('idna')292293 # Encode the path to to utf-8.294 if isinstance(path, unicode):295 path = path.encode('utf-8')296297 # URL-encode the path.298 path = urllib.quote(path, safe="%/:=&?~#+!$,;'@()*[]")293 self.url = str(urlunparse([ scheme, netloc, path, params, query, fragment ]))299300 # Turn it back into a bytestring.301 self.url = str(urlunparse([scheme, netloc, path, params, query, fragment]))302303 # Query Parameters?304 if self._enc_params:305306 # If query parameters already exist in the URL, append.307 if urlparse(self.url).query:308 return '%s&%s' % (self.url, self._enc_params)309310 # Otherwise, have at it.311 else:312 return '%s?%s' % (self.url, self._enc_params)313314 else:315 # Kosher URL.316 return self.url317318319 def send(self, connection=None, anyway=False):
461 unmodified lines