Hello pywikibot maintainers,
My bot, that is using nightly version (/data/project/shared/pywikibot/core/ on toolforge), is stuck with the following error since April 20.
The zone of the codebase that corresponds was edited by @Xqt in the following commit, but I don't see immediately where is the mistake here: https://github.com/wikimedia/pywikibot/commit/77ecbd1a753a2b518d5be89c8627265caae92564
I guess backline char (\n) has no place in user-agent string.
tools.framabot@shell:~$ ~/venv3.11/bin/python3 /data/project/shared/pywikibot/core/pwb.py login fatal: detected dubious ownership in repository at '/data/project/pywikibot/public_html/core' To add an exception for this directory, call: git config --global --add safe.directory /data/project/pywikibot/public_html/core ERROR: Traceback (most recent call last): File "/data/project/pywikibot/public_html/core/pywikibot/data/api/_requests.py", line 684, in _http_request response = http.request(self.site, uri=uri, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/project/pywikibot/public_html/core/pywikibot/comms/http.py", line 283, in request r = fetch(baseuri, headers=headers, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/project/pywikibot/public_html/core/pywikibot/comms/http.py", line 457, in fetch callback(response) File "/data/project/pywikibot/public_html/core/pywikibot/comms/http.py", line 337, in error_handling_callback raise FatalServerError(str(response)) pywikibot.exceptions.FatalServerError: Invalid leading whitespace, reserved character(s), or returncharacter(s) in header value: 'login (wikipedia:fr; User:Framabot) Pywikibot/9.2.0.dev1 (1\n) requests/2.31.0 Python/3.11.2.final.0' Traceback (most recent call last): File "/data/project/shared/pywikibot/core/pwb.py", line 40, in <module> sys.exit(main()) ^^^^^^ File "/data/project/shared/pywikibot/core/pwb.py", line 36, in main runpy.run_path(str(path), run_name='__main__') File "<frozen runpy>", line 291, in run_path File "<frozen runpy>", line 98, in _run_module_code File "<frozen runpy>", line 88, in _run_code File "/data/project/shared/pywikibot/core/pywikibot/scripts/wrapper.py", line 521, in <module> main() File "/data/project/shared/pywikibot/core/pywikibot/scripts/wrapper.py", line 505, in main if not execute(): ^^^^^^^^^ File "/data/project/shared/pywikibot/core/pywikibot/scripts/wrapper.py", line 492, in execute run_python_file(filename, script_args, module) File "/data/project/shared/pywikibot/core/pywikibot/scripts/wrapper.py", line 149, in run_python_file exec(compile(source, filename, 'exec', dont_inherit=True), File "/data/project/shared/pywikibot/core/pywikibot/scripts/login.py", line 178, in <module> main() File "/data/project/shared/pywikibot/core/pywikibot/scripts/login.py", line 141, in main for arg in pywikibot.handle_args(args): ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/project/pywikibot/public_html/core/pywikibot/bot.py", line 832, in handle_args pywikibot.Site() File "/data/project/pywikibot/public_html/core/pywikibot/__init__.py", line 243, in Site _sites[key] = interface(code=code, fam=fam, user=user) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/project/pywikibot/public_html/core/pywikibot/site/_apisite.py", line 140, in __init__ self.login(cookie_only=True) File "/data/project/pywikibot/public_html/core/pywikibot/site/_apisite.py", line 400, in login if self.userinfo['name'] == self.user(): ^^^^^^^^^^^^^ File "/data/project/pywikibot/public_html/core/pywikibot/site/_apisite.py", line 670, in userinfo uidata = uirequest.submit() ^^^^^^^^^^^^^^^^^^ File "/data/project/pywikibot/public_html/core/pywikibot/data/api/_requests.py", line 993, in submit response, use_get = self._http_request(use_get, uri, body, headers, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/project/pywikibot/public_html/core/pywikibot/data/api/_requests.py", line 684, in _http_request response = http.request(self.site, uri=uri, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/project/pywikibot/public_html/core/pywikibot/comms/http.py", line 283, in request r = fetch(baseuri, headers=headers, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/project/pywikibot/public_html/core/pywikibot/comms/http.py", line 457, in fetch callback(response) File "/data/project/pywikibot/public_html/core/pywikibot/comms/http.py", line 337, in error_handling_callback raise FatalServerError(str(response)) pywikibot.exceptions.FatalServerError: Invalid leading whitespace, reserved character(s), or returncharacter(s) in header value: 'login (wikipedia:fr; User:Framabot) Pywikibot/9.2.0.dev1 (1\n) requests/2.31.0 Python/3.11.2.final.0' CRITICAL: Exiting due to uncaught exception FatalServerError: Invalid leading whitespace, reserved character(s), or returncharacter(s) in header value: 'login (wikipedia:fr; User:Framabot) Pywikibot/9.2.0.dev1 (1\n) requests/2.31.0 Python/3.11.2.final.0' tools.framabot@shell:~$