Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix python 3.10 bug by updating dependencies #104

Merged
merged 1 commit into from
Jun 22, 2022
Merged

Conversation

cs01
Copy link
Owner

@cs01 cs01 commented Jun 22, 2022

  • I have added an entry to CHANGELOG.md

Summary of changes

Fix error so Python 3.10 can use termpair.

The fix was to update the websockets package.

Ran

pip-compile > requirements.txt

which updated dependencies and fixed the issue

Test plan

Before

> termpair share --host "https://chadsmith.dev/termpair/" --port 443
TermPair encountered an error. If you think this is a bug, it can be reported at https://github.com/cs01/termpair/issues

Traceback (most recent call last):
  File "/home/csmith/git/termpair/termpair/main.py", line 135, in main
    run_command(args)
  File "/home/csmith/git/termpair/termpair/main.py", line 111, in run_command
    asyncio.get_event_loop().run_until_complete(
  File "/usr/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
    return future.result()
  File "/home/csmith/git/termpair/termpair/share.py", line 413, in broadcast_terminal
    async with websockets.connect(ws_endpoint, ssl=ssl_context) as ws:
  File "/home/csmith/git/termpair/venv/lib/python3.10/site-packages/websockets/legacy/client.py", line 604, in __aenter__
    return await self
  File "/home/csmith/git/termpair/venv/lib/python3.10/site-packages/websockets/legacy/client.py", line 622, in __await_impl__
    transport, protocol = await self._create_connection()
  File "/usr/lib/python3.10/asyncio/base_events.py", line 1080, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/usr/lib/python3.10/asyncio/base_events.py", line 1098, in _create_connection_transport
    protocol = protocol_factory()
  File "/home/csmith/git/termpair/venv/lib/python3.10/site-packages/websockets/legacy/client.py", line 160, in __init__
    super().__init__(**kwargs)
  File "/home/csmith/git/termpair/venv/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 154, in __init__
    self._drain_lock = asyncio.Lock(
  File "/usr/lib/python3.10/asyncio/locks.py", line 77, in __init__
    super().__init__(loop=loop)
  File "/usr/lib/python3.10/asyncio/mixins.py", line 17, in __init__
    raise TypeError(
TypeError: As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary

After

> termpair share --host "https://chadsmith.dev/termpair/" --port 443

works

@cs01 cs01 changed the title update requirements.txt fix python 3.10 bug by updating dependencies Jun 22, 2022
@cs01 cs01 force-pushed the cs01/fix-python-3.10-bug branch 3 times, most recently from 1821a38 to 1e68e2c Compare June 22, 2022 05:23
@cs01 cs01 force-pushed the cs01/fix-python-3.10-bug branch from 1e68e2c to e2dd791 Compare June 22, 2022 05:28
@cs01 cs01 merged commit 9424c9d into master Jun 22, 2022
@cs01 cs01 deleted the cs01/fix-python-3.10-bug branch June 22, 2022 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant