python control library broken with latest update
Bug report
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: 3.4.6
- OS version: OSX com.googlecode.iterm2.plist10.14.6
- Attach
~/Library/Preferences/com.googlecode.iterm2.plist
here (drag-drop from finder into this window) - Attach a debug log, if possible.
- Attach a screen capture video if it would make the reproduction steps clearer.
PLEASE ATTACH YOUR PLIST FILE FOR BUG REPORTS! Seriously! I'll probably ask you for it if you don’t.
Detailed steps to reproduce the problem
- After upgrade, update iterm2 python control library; pip3 install --upgrade iterm2 pip3 install --upgrade websocket-client pip3 install --upgrade more_itertools
- Run my custom iterm startup script to open iterm with tabs running specific tools
What happened
~/code/order-management dev startsam
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/iterm2/connection.py", line 407, in async_connect
async with self._get_connect_coro() as websocket:
File "/usr/local/lib/python3.9/site-packages/iterm2/connection.py", line 324, in _get_connect_coro
return self._get_unix_connect_coro()
File "/usr/local/lib/python3.9/site-packages/iterm2/connection.py", line 346, in _get_unix_connect_coro
return websockets.client.unix_connect(
File "/usr/local/lib/python3.9/site-packages/websockets/imports.py", line 96, in __getattr__
raise AttributeError(f"module {package!r} has no attribute {name!r}")
AttributeError: module 'websockets' has no attribute 'client'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/ross/bin/startsam", line 86, in <module>
iterm2.run_until_complete(main)
File "/usr/local/lib/python3.9/site-packages/iterm2/connection.py", line 499, in run_until_complete
return Connection().run_until_complete(coro, retry, debug)
File "/usr/local/lib/python3.9/site-packages/iterm2/connection.py", line 146, in run_until_complete
return self.run(False, coro, retry, debug)
File "/usr/local/lib/python3.9/site-packages/iterm2/connection.py", line 231, in run
return loop.run_until_complete(self.async_connect(async_main, retry))
File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/usr/local/lib/python3.9/site-packages/iterm2/connection.py", line 416, in async_connect
except websockets.exceptions.InvalidStatusCode as exception:
File "/usr/local/lib/python3.9/site-packages/websockets/imports.py", line 96, in __getattr__
raise AttributeError(f"module {package!r} has no attribute {name!r}")
AttributeError: module 'websockets' has no attribute 'exceptions'
## What should have happened
Script should have started successfully.
---
Edited by George Nachman