Last modified: 2014-10-07 09:00:50 UTC
If a file already exists on the server with the same title, chunked Site.upload fails with: Traceback (most recent call last): File "tests/upload_tests.py", line 45, in test_png_chunked ignore_warnings=True, chunk_size=1024) File ".../pywikibot/tools.py", line 367, in wrapper return method(*__args, **__kw) File ".../pywikibot/site.py", line 4404, in upload % {'msg': message}) UploadWarning: exists: File MP_sounds-pwb.png already exists. Chunked uploading with a new title works correctly: https://test.wikipedia.org/wiki/File:MP_sounds-pwb-chunked.png
In addition to a bug in pywikibot (already fixed in bug 71400), there appears to also be a bug in mediawiki (bug 71737), as the API response does not include an offset which our code currently relies on.
This is actually the same error as in bug 58907 (just that we have to catch it at a different place). Open another report about the missing offset. I tested the chunked upload locally on a test server (1.23 though) and there I always got a offset result. But as long as the new offset is simply "old offset + chunk size" we can do that calculation (if needed) on our own. *** This bug has been marked as a duplicate of bug 58907 ***