jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1026185?usp=email )
Change subject: version.py: Remove line endings in getversion_nightly
......................................................................
version.py: Remove line endings in getversion_nightly
The version strings are eventually passed into the user agent, and
having a linebreak results in a user agent such as:
script (wikipedia:test; User:Bot) Pywikibot/9.2.0.dev1 (1\n)
requests/2.28.2 Python/3.9.2.final.0
This \n causes the result to fail with error:
pywikibot.exceptions.FatalServerError: Invalid leading whitespace,
reserved character(s), or returncharacter(s) in header value.
Fix this by, instead of using readlines, which preserves the line
endings, read the entire file and split by linebreak, which implicitly
removes all the line endings.
Bug: T363943
Change-Id: I38f9b27d3339916dc6b784ecda602055924aa6bc
---
M pywikibot/version.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/version.py b/pywikibot/version.py
index 542c480..40793a0 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -259,7 +259,7 @@
file = Path(path or _get_program_dir()) / 'pywikibot' / 'version'
with file.open() as data:
- (tag, rev, date, hsh) = data.readlines()
+ (tag, rev, date, hsh) = data.read().splitlines()
date = time.strptime(date[:19], '%Y-%m-%dT%H:%M:%S')
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1026185?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I38f9b27d3339916dc6b784ecda602055924aa6bc
Gerrit-Change-Number: 1026185
Gerrit-PatchSet: 3
Gerrit-Owner: Zhuyifei1999 <zhuyifei1999(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1026598?usp=email )
Change subject: [cleanup] i18n.TranslationError was removed in Pywikibot 7
......................................................................
[cleanup] i18n.TranslationError was removed in Pywikibot 7
Change-Id: I37be3ce061631b9a77db4c27d30fd7767ff87eac
---
M pywikibot/exceptions.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py
index 998c2c8..9104e7b 100644
--- a/pywikibot/exceptions.py
+++ b/pywikibot/exceptions.py
@@ -77,11 +77,11 @@
- NoUsernameError: Username is not in user config file, or it is invalid.
- PageInUseError: Page cannot be reserved due to a lock
- SectionError: The section specified by # does not exist
- - TranslationError: no language translation found
+ - TranslationError: no language translation found, i18n/l10n message
+ not available
- UnknownExtensionError: Extension is not defined for this site
- UserRightsError: insufficient rights for requested action
- VersionParseError: failed to parse version information
- - i18n.TranslationError: i18n/l10n message not available
APIError: wiki API returned an error
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1026598?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I37be3ce061631b9a77db4c27d30fd7767ff87eac
Gerrit-Change-Number: 1026598
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1026584?usp=email )
Change subject: [tests] upload_tests is a framework test rather than a script test
......................................................................
[tests] upload_tests is a framework test rather than a script test
Change-Id: Ic1a734bbce7e7e7ed22cf7a4036f6da91b027a45
---
M docs/tests_ref/index.rst
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/docs/tests_ref/index.rst b/docs/tests_ref/index.rst
index 7340817..22fed99 100644
--- a/docs/tests_ref/index.rst
+++ b/docs/tests_ref/index.rst
@@ -79,6 +79,7 @@
tools<./tools_tests>
ui_options<./ui_options_tests>
ui<./ui_tests>
+ upload<./upload_tests>
user<./user_tests>
utils
wikibase_edit<./wikibase_edit_tests>
@@ -117,5 +118,4 @@
reflinks<./reflinks_tests>
replacebot<./replacebot_tests>
template_bot<./template_bot_tests>
- upload<./upload_tests>
uploadbot<./uploadbot_tests>
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1026584?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ic1a734bbce7e7e7ed22cf7a4036f6da91b027a45
Gerrit-Change-Number: 1026584
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged