jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Allow apostrophe in password
......................................................................
[FIX] Allow apostrophe in password
If the password contains an apostrophe it'll mess up the line in the password
file. E.g. if the password is "foo'bar" it'll add the following line:
('username', 'foo'bar')
This escapes now any quotes and it'll generate the following line:
('username', 'foo\'bar')
Bug: T105783
Change-Id: I45501958362ef07e20b73448a11f11a4160f3136
(cherry picked from commit ac07c7a09ca43c66bb5352533ac88d766d64bdbf)
---
M .travis.yml
M tests/README.rst
2 files changed, 4 insertions(+), 2 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.travis.yml b/.travis.yml
index 6135c7f..0ffea0d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -48,7 +48,7 @@
echo "usernames['wikipedia']['test'] =
'$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
echo "usernames['wikidata']['test'] =
'$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
echo "usernames['commons']['commons'] =
'$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
- echo "('$PYWIKIBOT2_USERNAME', '$USER_PASSWORD')" >
~/.pywikibot/passwordfile ;
+ printf "('%q', '%q')\n" "$PYWIKIBOT2_USERNAME"
"$USER_PASSWORD" > ~/.pywikibot/passwordfile ;
echo "import os" >> ~/.pywikibot/user-config.py ;
echo "password_file =
os.path.expanduser('~/.pywikibot/passwordfile')" >>
~/.pywikibot/user-config.py ;
fi
diff --git a/tests/README.rst b/tests/README.rst
index 3080680..2f9f91a 100644
--- a/tests/README.rst
+++ b/tests/README.rst
@@ -109,7 +109,9 @@
4. The next build should run tests that require a logged in user
While passwords in travis-ci environment variables are not leaked in normal
-operations, you are responsible for your own passwords.
+operations, you are responsible for your own passwords. If the password contains
+single quotes it is necessary to surround them in double quotes (see also
+`travis-ci #4350 <https://github.com/travis-ci/travis-ci/issues/4350>`_).
It is strongly recommended that an untrusted bot account is created for
travis tests, using a password that is not shared with trusted accounts.
--
To view, visit
https://gerrit.wikimedia.org/r/242521
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I45501958362ef07e20b73448a11f11a4160f3136
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>