Correction: it was the validation
debugging before and after the line 221 on webapi.py:
defaults.setdefault('_unicode', True)
the contents of the "defaults" dict varies (1 is before, 2 is after that line):
1 {'_unicode': False, 'myfile': {}} -> ['myfile'] 992166 2 {'_unicode': False, 'myfile': {}} -> ['myfile'] 992166 1 {} -> ['myfile'] 992166 2 {'_unicode': True} -> ['myfile'] 992166
This is the output for 1 upload POST request, running through validation and accessing it later. It seems the contents are emptied somehow, and then the default _unicode value is applied to the uploaded file, which causes the break.
Correction: it was the validation
debugging before and after the line 221 on webapi.py:
the contents of the "defaults" dict varies (1 is before, 2 is after that line):
1 {'_unicode': False, 'myfile': {}} -> ['myfile'] 992166
2 {'_unicode': False, 'myfile': {}} -> ['myfile'] 992166
1 {} -> ['myfile'] 992166
2 {'_unicode': True} -> ['myfile'] 992166
This is the output for 1 upload POST request, running through validation and accessing it later. It seems the contents are emptied somehow, and then the default _unicode value is applied to the uploaded file, which causes the break.