jenkins-bot merged this change.

View Change

Approvals: JJMC89: Looks good to me, but someone else must approve Xqt: Looks good to me, approved jenkins-bot: Verified
[bugfix] Fix error thrown on saving user-passwords.py

"AttributeError: module 'pywikibot' has no attribute 'tools'"

Change-Id: I2867d185dd7a8f7bc99d5eec713df54deface921
---
M generate_user_files.py
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/generate_user_files.py b/generate_user_files.py
index 87562fb..916d5b3 100755
--- a/generate_user_files.py
+++ b/generate_user_files.py
@@ -18,6 +18,8 @@

from generate_family_file import _import_with_no_user_config

+from pywikibot.tools import file_mode_checker
+
# DISABLED_SECTIONS cannot be copied; variables must be set manually
DISABLED_SECTIONS = {'USER INTERFACE SETTINGS', # uses sys
'EXTERNAL EDITOR SETTINGS', # uses os
@@ -378,11 +380,10 @@
# in it
with codecs.open(_fncpass, 'w', 'utf-8') as f:
f.write('')
- pywikibot.tools.file_mode_checker(_fncpass, mode=0o600,
- quiet=True)
+ file_mode_checker(_fncpass, mode=0o600, quiet=True)
with codecs.open(_fncpass, 'w', 'utf-8') as f:
f.write(PASSFILE_CONFIG.format(botpasswords=botpasswords))
- pywikibot.tools.file_mode_checker(_fncpass, mode=0o600)
+ file_mode_checker(_fncpass, mode=0o600)
pywikibot.output("'{0}' written.".format(_fncpass))
except EnvironmentError:
os.remove(_fncpass)

To view, visit change 499874. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2867d185dd7a8f7bc99d5eec713df54deface921
Gerrit-Change-Number: 499874
Gerrit-PatchSet: 3
Gerrit-Owner: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia@gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki@gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus@gmx.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)