Steps to replicate the issue (include links if applicable):
A connection error is encountered from an event stream
What happens?:
When attempting to re-establish a connection a TypeError is raised.
WARNING: Connection error: fetch https://stream.wikimedia.org/v2/stream/mediawiki.page_change.v1 failed with wrong response status: 500.
Try to re-establish connection.
Traceback (most recent call last):
File "/var/www/.venv/bin/copypatrol-backend", line 8, in <module>
sys.exit(cli())
^^^^^
File "/var/www/.venv/lib/python3.11/site-packages/copypatrol_backend/cli.py", line 268, in cli
store_changes(since=parsed_args.since, total=parsed_args.total)
File "/var/www/.venv/lib/python3.11/site-packages/copypatrol_backend/cli.py", line 25, in store_changes
for event in change_stream(since=since, total=total):
File "/var/www/.venv/lib/python3.11/site-packages/copypatrol_backend/stream_listener.py", line 49, in change_stream
yield from stream
File "<frozen _collections_abc>", line 330, in __next__
File "/var/www/.venv/lib/python3.11/site-packages/pywikibot/tools/collections.py", line 278, in send
return next(self._started_gen)
^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/.venv/lib/python3.11/site-packages/pywikibot/comms/eventstreams.py", line 379, in generator
self.source.connect(config.max_retries)
File "/var/www/.venv/lib/python3.11/site-packages/requests_sse/client.py", line 259, in connect
response = self._session.request(
^^^^^^^^^^^^^^^^^^^^^^
TypeError: Session.request() got an unexpected keyword argument 'last_event_id'
CRITICAL: Exiting due to uncaught exception TypeError: Session.request() got an unexpected keyword argument 'last_event_id'What should have happened instead?:
A TypeError is not raised by using latest_event_id instead of last_event_id because the keyword is used by requests_sse.EventSource.
Software version:
- pywikibot: 10.0.0
- requests-sse: 0.5.1