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):
--
To view, visit https://gerrit.wikimedia.org/r/299262
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ife628004680399e047a75d1443e1d7ac0a22aabf
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil <lokal.profil(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Lokal Profil <lokal.profil(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: 7za does not display Everything is Ok on stderr
......................................................................
7za does not display Everything is Ok on stderr
As of 15.14 7za does not display Everything is Ok on stderr
after successfully extracting the content of an archive. Replace this
sanity check with a verification that nothing is displayed on stderr
instead. Any message showing on stderr is considered a fatal error.
Bug: T141608
Change-Id: I3a48f5f1ad2965c4d917290b048f94ab19c79bf2
---
M pywikibot/tools/__init__.py
1 file changed, 4 insertions(+), 4 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index ff94c70..40f7320 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -1057,15 +1057,15 @@
stderr=subprocess.PIPE,
bufsize=65535)
except OSError:
- raise ValueError('7za is not installed and can not '
+ raise ValueError('7za is not installed or cannot '
'uncompress "{0}"'.format(filename))
else:
stderr = process.stderr.read()
process.stderr.close()
- if b'Everything is Ok' not in stderr:
+ if stderr != b'':
process.stdout.close()
- # OSError is also raised when bz2 is invalid
- raise OSError('Invalid 7z archive.')
+ raise OSError(
+ 'Unexpected STDERR output from 7za {0}'.format(stderr))
else:
return process.stdout
else:
--
To view, visit https://gerrit.wikimedia.org/r/301771
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3a48f5f1ad2965c4d917290b048f94ab19c79bf2
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dachary <loic(a)dachary.org>
Gerrit-Reviewer: Dachary <loic(a)dachary.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>