Greetings!
I'm trying to mass re-upload new versions of existing files to Fandom using Pywikibot, but get an error. Here is a part of output from one attempt
Uploading file to ageofempires:en...
WARNING: /home/user/pywikibot/core/pywikibot/page/__init__.py:2565: FutureWarning: "ignore_warnings" as a boolean and "report_success" is True or None is deprecated for 5 years and 4 months; use "report_success=False" or define "ignore_warnings" as callable/iterable instead.
return self.site.upload(self, source_filename=filename, source_url=url,
WARNING: API error fileexists-forbidden: A file with this name already exists, and cannot be overwritten. If you still want to upload your file, please go back and use a new name. [[File:Britons_King_Move_3_AoE2.ogg|thumb|center|Britons_King_Move_3_AoE2.ogg]]
API Error: query=
("{'action': ['upload'], 'token': "
"['here_was_token'], 'text': ['New version"
'with higher quality of a dialogue file for a Briton unit in Age of Empires'
"2'], 'filename': ['Britons King Move 3 AoE2.ogg'], 'comment': ['New version"
'with higher quality of a dialogue file for a Briton unit in Age of Empires'
"2'], 'assert': ['user'], 'watch': [False], 'ignorewarnings': [True],"
"'maxlag': ['5'], 'format':['json']}")
response=
{'error': {'code': 'fileexists-forbidden', 'info': 'A file with this name already exists, and cannot be overwritten. If you still want to upload your file, please go back and use a new name. [[File:Britons_King_Move_3_AoE2.ogg|thumb|center|Britons_King_Move_3_AoE2.ogg]]', 'filekey': '181qqtpbrbxc.p9l6p4.47783138.ogx', 'sessionkey': '181qqtpbrbxc.p9l6p4.47783138.ogx', 'invalidparameter': 'filename', 'help': 'See https://ageofempires.fandom.com/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.'}}
ERROR: Upload error:I contacted Fandom support and they pointed out that according to here ignore_warnings must be set to reupload.