Page MenuHomePhabricator

"Password line too long or too complex"
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Create a user-password.py file.
  • Add a ('SiteCode', 'FamilyName', 'Username', BotPassword('BotName', 'Password')) entry to user-password.py, including all fields.

What happens?:
If I use a ('SiteCode', 'FamilyName', 'Username', BotPassword('BotName', 'Password')) format in my user-password.py, the message "Password line too long or too complex" appears.

What should have happened instead?:
I think this is due to the line "line.count(',') > 3" : https://github.com/wikimedia/pywikibot/blob/master/pywikibot/login.py#L265 because my password line contains four (> 3) commas including the comma between the two args of BotPassword.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
Pywikibot 10.7.2

Other information (browser name/version, screenshots, etc.):

Event Timeline

Xqt changed the task status from Open to In Progress.Dec 10 2025, 11:08 AM
Xqt claimed this task.
Xqt triaged this task as High priority.

Change #1217148 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@stable] [10.7.3] Publish Pywikibot 10.7.4 stable release

https://gerrit.wikimedia.org/r/1217148

Change #1217153 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] Fix extracting password line

https://gerrit.wikimedia.org/r/1217153

@Simon-kempf: Thank you for your valuable bug report. Are you able to review my patches?

Change #1217499 had a related patch set uploaded (by Prakhar0804; author: Prakhar0804):

[pywikibot/core@master] Fix BotPassword validation to accept 4-tuple format

https://gerrit.wikimedia.org/r/1217499

Change #1217706 had a related patch set uploaded (by Prakhar0804; author: Prakhar0804):

[pywikibot/core@master] Fix BotPassword validation to accept 4-tuple format

https://gerrit.wikimedia.org/r/1217706

Change #1217706 abandoned by Xqt:

[pywikibot/core@master] Fix BotPassword validation to accept 4-tuple format

Reason:

duplicate of https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1217499

https://gerrit.wikimedia.org/r/1217706

Change #1217153 merged by Xqt:

[pywikibot/core@master] Fix extracting password line

https://gerrit.wikimedia.org/r/1217153

Change #1217148 merged by Xqt:

[pywikibot/core@stable] [10.7.3] Publish Pywikibot 10.7.4 stable release

https://gerrit.wikimedia.org/r/1217148

Change #1217499 abandoned by Xqt:

[pywikibot/core@master] Add a test for BotPassword validation to accept 4-tuple format

Reason:

already solved

https://gerrit.wikimedia.org/r/1217499