Steps to Reproduce:
- Run python pwb.py login
- Type incorrect password
Actual Results:
You will get this:
1 | zoran@zoran-notebook:~/development/core$ nano user-config.py |
---|---|
2 | zoran@zoran-notebook:~/development/core$ python3 pwb.py login |
3 | Password for user Zoranzoki21 on wikipedia:sr (no characters will be shown): |
4 | Logging in to wikipedia:sr as Zoranzoki21 |
5 | ERROR: Login failed (Failed). |
6 | Traceback (most recent call last): |
7 | File "/home/zoran/development/core/pywikibot/login.py", line 313, in login |
8 | cookiedata = self.getCookie() |
9 | File "/home/zoran/development/core/pywikibot/tools/__init__.py", line 1823, in wrapper |
10 | return obj(*new_args, **new_kwargs) |
11 | File "/home/zoran/development/core/pywikibot/data/api.py", line 3301, in getCookie |
12 | raise APIError(code=login_result['login']['result'], info=info) |
13 | pywikibot.data.api.APIError: Failed: Incorrect username or password entered. Please try again. |
14 | |
15 | During handling of the above exception, another exception occurred: |
16 | |
17 | Traceback (most recent call last): |
18 | File "pwb.py", line 257, in <module> |
19 | if not main(): |
20 | File "pwb.py", line 250, in main |
21 | run_python_file(filename, [filename] + args, argvu, file_package) |
22 | File "pwb.py", line 119, in run_python_file |
23 | main_mod.__dict__) |
24 | File "./scripts/login.py", line 198, in <module> |
25 | main() |
26 | File "./scripts/login.py", line 180, in main |
27 | site.login(sysop, autocreate=autocreate) |
28 | File "/home/zoran/development/core/pywikibot/site.py", line 2104, in login |
29 | if login_manager.login(retry=True, autocreate=autocreate): |
30 | File "/home/zoran/development/core/pywikibot/login.py", line 329, in login |
31 | '{1}\n.{2}'.format(self.login_name, self.site, e.info)) |
32 | pywikibot.exceptions.NoUsername: Username "Zoranzoki21" does not have read permissions on wikipedia:sr |
33 | .Incorrect username or password entered. Please try again. |
34 | <class 'pywikibot.exceptions.NoUsername'> |
35 | CRITICAL: Closing network session. |
36 | zoran@zoran-notebook:~/development/core$ |
Expected Results:
pywikibot.exceptions.NoUsername should not happen and output should be something like this:
1 | zoran@zoran-notebook:~/development/core$ nano user-config.py |
---|---|
2 | zoran@zoran-notebook:~/development/core$ python3 pwb.py login |
3 | Password for user Zoranzoki21 on wikipedia:sr (no characters will be shown): |
4 | Logging in to wikipedia:sr as Zoranzoki21 |
5 | ERROR: Login failed (Failed). Incorrect username or password entered. Please try again. |
6 | Password for user Zoranzoki21 on wikipedia:sr (no characters will be shown): |
Version:
1 | zoran@zoran-notebook:~/development/core$ python3 pwb.py version |
---|---|
2 | Pywikibot: [ssh] pywikibot-core (73f07ba, g10390, 2018/11/09, 09:23:55, ok) |
3 | Release version: 3.1.dev0 |
4 | requests version: 2.18.4 |
5 | cacerts: /etc/ssl/certs/ca-certificates.crt |
6 | certificate test: ok |
7 | Python: 3.6.6 (default, Sep 12 2018, 18:26:19) |
8 | [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] |
9 | PYWIKIBOT_DIR: Not set |
10 | PYWIKIBOT_DIR_PWB: |
11 | PYWIKIBOT_NO_USER_CONFIG: Not set |
12 | Config base dir: /home/zoran/development/core |
13 | Usernames for family "wikipedia": |
14 | sr: Zoranzoki21 (no sysop configured) |
15 | Usernames for family "translatewiki": |
16 | en: Zoranzoki21-Bot (no sysop configured) |
17 | Usernames for family "testwiki": |
18 | sr: Zoranzoki21 (also sysop) |
19 | zoran@zoran-notebook:~/development/core$ |