Skip to content
Myr

model the encode_files data handling after encode_params

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

authored by Jason Emerick · committed by Jason Emerick · parent 168c3e6 · Browse files · 1 file+7 added−5 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+7 added−5 removed

  • other:+7 added−5 removed

1 file+7 added−5 removed

modified:requests/models.py+7 added-5 removed
97 unmodified lines
98 fields = to_key_val_list(data or {})99 files = to_key_val_list(files or {})100101 for field, val in fields:102 if isinstance(val, list):103 for v in val:104 new_fields.append((field, str(v)))105 else:106 new_fields.append((field, str(val)))102 if isinstance(val, basestring) or not hasattr(val, '__iter__'):103 val = [val]104 for v in val:105 if v is not None:106 new_fields.append(107 (field.encode('utf-8') if isinstance(field, str) else field,108 v.encode('utf-8') if isinstance(v, str) else v))109110 for (k, v) in files:111 # support for explicit filename112 ft = None
563 unmodified lines