jenkins-bot has submitted this change and it was merged.
Change subject: Add two upload warnings ......................................................................
Add two upload warnings
Adds the bad-prefix and the page-exists upload warnings.
Also add graceful handling of simulation mode when using chunked uploading.
Change-Id: Ife628004680399e047a75d1443e1d7ac0a22aabf --- M pywikibot/site.py 1 file changed, 5 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index f8c6996..c9da9c1 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -5706,7 +5706,7 @@
upload_warnings = { # map API warning codes to user error messages - # %(msg)s will be replaced by message string from API responsse + # %(msg)s will be replaced by message string from API response 'duplicate-archive': "The file is a duplicate of a deleted file %(msg)s.", 'was-deleted': "The file %(msg)s was previously deleted.", 'emptyfile': "File %(msg)s is empty.", @@ -5716,6 +5716,8 @@ 'filetype-unwanted-type': "File %(msg)s type is unwanted type.", 'exists-normalized': 'File exists with different extension as ' '"%(msg)s".', + 'bad-prefix': 'Target filename has a bad prefix %(msg)s.', + 'page-exists': 'Target filename exists but with a different file %(msg)s.', }
# An offset != 0 doesn't make sense without a file key @@ -5877,6 +5879,8 @@ if error.code == u'uploaddisabled': self._uploaddisabled = True raise error + if 'nochange' in data: # in simulation mode + break _file_key = data['filekey'] if 'warnings' in data and not ignore_all_warnings: if callable(ignore_warnings):
pywikibot-commits@lists.wikimedia.org