https://bugzilla.wikimedia.org/show_bug.cgi?id=71727
Bug ID: 71727 Summary: chunked upload does not ignore warnings Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: network Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: jayvdb@gmail.com Web browser: --- Mobile Platform: ---
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
https://bugzilla.wikimedia.org/show_bug.cgi?id=71727
--- Comment #1 from John Mark Vandenberg jayvdb@gmail.com --- 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.
https://bugzilla.wikimedia.org/show_bug.cgi?id=71727
Fabian CommodoreFabianus@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |CommodoreFabianus@gmx.de Resolution|--- |DUPLICATE
--- Comment #2 from Fabian CommodoreFabianus@gmx.de --- 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 ***
pywikipedia-bugs@lists.wikimedia.org