On an upload of "File:Scanwings, OH-BCX, Beechcraft C90 King Air (17512831479).jpg" to Commons:
Using HEAD, upload fail with a loophole of
ERROR: Traceback (most recent call last): File "/data/project/yifeibot/pywikibot/pywikibot/data/api.py", line 1555, in submit body=body, headers=headers) File "/data/project/yifeibot/pywikibot/pywikibot/tools/__init__.py", line 950, in wrapper return obj(*__args, **__kw) File "/data/project/yifeibot/pywikibot/pywikibot/comms/http.py", line 269, in request r = fetch(baseuri, method, body, headers, **kwargs) File "/data/project/yifeibot/pywikibot/pywikibot/comms/http.py", line 370, in fetch error_handling_callback(request) File "/data/project/yifeibot/pywikibot/pywikibot/comms/http.py", line 287, in error_handling_callback raise request.data UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 1872: ordinal not in range(128) WARNING: Waiting 5 seconds before retrying.
After debugging, I found all versions after 1e54a7d6886d56a21101900025038e25bab5ad03 has the same error, while version before raises an (expected) exception that is handled in botscript:
KeyError: u'bad-prefix'
I agree that some errors should be prevented from uploading. But why is there a UnicodeDecodeError leading to a loophole?