Skip to content
Myr

added unicode strings

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

authored by barberj · committed by Shivaram Lingamneni · parent 0a7d988 · Browse files · 2 files+10 added−1 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+10 added−1 removed

  • tests:+9 added−0 removed
  • other:+1 added−1 removed

2 files+10 added−1 removed

modified:requests/models.py+1 added-1 removed
346 unmodified lines
347 fn, fp = v348 else:349 fn = guess_filename(v) or k350 fp = v351 if isinstance(fp, bytes):351 if isinstance(fp, (bytes, str)):352 fp = StringIO(fp)353 fields.update({k: (fn, fp.read())})354355 (body, content_type) = encode_multipart_formdata(fields)
480 unmodified lines
modified:tests/test_requests.py+9 added
342 unmodified lines
343344 post3 = post(url, files={'fname.txt': 'fdata', 'fname2.txt':open(__file__,'rb')})345 self.assertEqual(post3.status_code, 200)346347 post4 = post(url, files={'fname.txt': u'fdata'})348 self.assertEqual(post4.status_code, 200)349350 post5 = post(url, files={'file': ('file.txt', 'more fdata')})351 self.assertEqual(post5.status_code, 200)352353 post6 = post(url, files={'fname.txt': u'\xe9'})354 self.assertEqual(post6.status_code, 200)355356 def test_nonzero_evaluation(self):357358 for service in SERVICES:359
541 unmodified lines