iterm2.rpc.RPCException: Invalid request. Upgrade iTerm2 to a newer version.
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: 3.2.6 Beta3 and 3.2.6
- OS version: Mojave
Detailed steps to reproduce the problem:
- Install https://pypi.org/project/iterm2/ 0.54
- Enable websocket api
- Try: https://iterm2.com/python-api/examples/sorttabs.html
What happened:
iterm2.rpc.RPCException: Invalid request. Upgrade iTerm2 to a newer version.
Traceback (most recent call last):
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/iterm2/connection.py", line 243, in async_connect
await coro(self)
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/iterm2/connection.py", line 152, in async_main
await coro(connection)
File "iterm-merge-windows", line 8, in main
app = await iterm2.async_get_app(connection)
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/iterm2/app.py", line 18, in async_get_app
App.instance = await App.async_construct(connection)
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/iterm2/app.py", line 52, in async_construct
await app.async_refresh_broadcast_domains()
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/iterm2/app.py", line 151, in async_refresh_broadcast_domains
response = await iterm2.rpc.async_get_broadcast_domains(self.connection)
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/iterm2/rpc.py", line 457, in async_get_broadcast_domains
return await _async_call(connection, request)
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/iterm2/rpc.py", line 601, in _async_call
raise RPCException(response.error)
iterm2.rpc.RPCException: Invalid request. Upgrade iTerm2 to a newer version.
Traceback (most recent call last):
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/websockets/protocol.py", line 674, in transfer_data
message = yield from self.read_message()
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/websockets/protocol.py", line 742, in read_message
frame = yield from self.read_data_frame(max_size=self.max_size)
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/websockets/protocol.py", line 815, in read_data_frame
frame = yield from self.read_frame(max_size)
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/websockets/protocol.py", line 884, in read_frame
extensions=self.extensions,
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/websockets/framing.py", line 99, in read
data = yield from reader(2)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py", line 677, in readexactly
raise IncompleteReadError(incomplete, n)
asyncio.streams.IncompleteReadError: 0 bytes read on a total of 2 expected bytes
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/iterm2/connection.py", line 115, in _async_dispatch_forever
data = await self.websocket.recv()
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/websockets/protocol.py", line 434, in recv
yield from self.ensure_open()
File "/Users/jm/.local/share/virtualenvs/.bin-aol-zqoP/lib/python3.7/site-packages/websockets/protocol.py", line 646, in ensure_open
) from self.transfer_data_exc
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1006 (connection closed abnormally [internal]), no reason
What should have happened: The script should have run.
I tried using both the beta and stable releases with no success.
PS: The docs should probably explain how to enable the websocket API.