Skip to content
Myr

Merge https://github.com/jgorset/requests into develop

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 · parents 9e0dcae, 23ee58d · Browse files · 2 files+9 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

2 files+9 added−4 removed

  • other:+9 added−4 removed

2 files+9 added−4 removed

modified:requests/core.py+7 added-4 removed
67 unmodified lines
68 self.url = url69 self.headers = headers70 self.files = files71 self.method = method72 72 self.data = data73 self.data = {}74 for (k, v) in data.items():75 self.data.update({76 k.encode('utf-8') if k.__class__ is unicode else k: \77 v.encode('utf-8') if v.__class__ is unicode else v78 })7980 socket.setdefaulttimeout(timeout)8176 for (k, v) in self.data.iteritems():77 self.data[k] = v.encode('utf-8')7882 # url encode data if it's a dict83 if hasattr(data, 'items'):84 self._enc_data = urllib.urlencode(self.data)85 else:
475 unmodified lines
modified:test_requests.py+2 added
139 unmodified lines
140 self.assertEquals(r.status_code, 200)141142 def test_unicode_get(self):143 requests.get('http://google.com', params={'foo': u'føø'})144 requests.get('http://google.com', params={u'føø': u'føø'})145 requests.get('http://google.com', params={'føø': 'føø'})146 requests.get('http://google.com', params={'foo': u'foo'})147 requests.get('http://google.com/ø', params={'foo': u'foo'})148149
2 unmodified lines