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

Python 3.9: TypeError: 'Lock' object is not iterable #20

Open
ivan opened this issue Nov 20, 2021 · 1 comment
Open

Python 3.9: TypeError: 'Lock' object is not iterable #20

ivan opened this issue Nov 20, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ivan
Copy link
Contributor

ivan commented Nov 20, 2021

/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/protocol/http/client.py:185: UserWarning: HTTP session did not complete.
  warnings.warn(_('HTTP session did not complete.'))
ERROR Fatal exception.
Traceback (most recent call last):
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/application/app.py", line 157, in run
    yield from pipeline.process()
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/pipeline/pipeline.py", line 194, in process
    yield from self._process_one_worker()
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/pipeline/pipeline.py", line 215, in _process_one_worker
    task.result()
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/pipeline/pipeline.py", line 119, in process
    item = yield from self.process_one(_worker_id=worker_id)
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/pipeline/pipeline.py", line 103, in process_one
    yield from task.process(item)
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/application/tasks/download.py", line 421, in process
    yield from session.app_session.factory['Processor'].process(session)
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/processor/delegate.py", line 29, in process
    return (yield from processor.process(item_session))
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/processor/web.py", line 91, in process
    return (yield from session.process())
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/processor/web.py", line 185, in process
    yield from self._process_loop()
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/processor/web.py", line 244, in _process_loop
    exit_early, wait_time = yield from self._fetch_one(cast(Request, self._item_session.request))
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/processor/web.py", line 267, in _fetch_one
    response = yield from self._web_client_session.start()
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/protocol/http/web.py", line 107, in start
    response = yield from session.start(request)
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/protocol/http/client.py", line 82, in start
    connection = yield from self._acquire_request_connection(request)
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/protocol/abstract/client.py", line 80, in _acquire_request_connection
    connection = yield from self._acquire_connection(host, port, use_ssl, tunnel)
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/protocol/abstract/client.py", line 92, in _acquire_connection
    connection = yield from \
  File "/nix/store/rag27j334bnkivkwis68q7avm85d3ij4-python3.9-ludios_wpull-3.0.9/lib/python3.9/site-packages/wpull/network/pool.py", line 187, in acquire
    with (yield from self._host_pools_lock):
TypeError: 'Lock' object is not iterable
CRITICAL Sorry, Wpull unexpectedly crashed.
Exception ignored in: <coroutine object Connect.__await_impl__ at 0x6d2275929240>
Traceback (most recent call last):
  File "/nix/store/gqaz3095xdgrxcqilkrqzxns5cvrl76v-python3.9-websockets-10.0/lib/python3.9/site-packages/websockets/legacy/client.py", line 653, in __await_impl__
    transport, protocol = await self._create_connection()
  File "/nix/store/fkzla307l4mlcvfyshsrccwl7szihx2z-python3-3.9.6/lib/python3.9/asyncio/base_events.py", line 1081, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/nix/store/fkzla307l4mlcvfyshsrccwl7szihx2z-python3-3.9.6/lib/python3.9/asyncio/base_events.py", line 1113, in _create_connection_transport
    transport.close()
  File "/nix/store/fkzla307l4mlcvfyshsrccwl7szihx2z-python3-3.9.6/lib/python3.9/asyncio/selector_events.py", line 700, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "/nix/store/fkzla307l4mlcvfyshsrccwl7szihx2z-python3-3.9.6/lib/python3.9/asyncio/base_events.py", line 746, in call_soon
    self._check_closed()
  File "/nix/store/fkzla307l4mlcvfyshsrccwl7szihx2z-python3-3.9.6/lib/python3.9/asyncio/base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

This is the result of

I am getting off the Python ride because of endless churn. A PR to fix all instances of this in ludios_wpull would be much appreciated.

Fixing this probably involves making a bunch of functions in ludios_wpull async.

ivan added a commit to ivan/nixpkgs that referenced this issue Nov 20, 2021
Use SQLAlchemy 1.3 because ludios_wpull is incompatible with SQLAlchemy 1.4.

Use Python 3.8 instead of Python 3.7, as namedlist 1.8 fixed compatibility
with Python 3.8. We cannot use Python 3.9 until
ArchiveTeam/ludios_wpull#20 is fixed.
@TheTechRobo
Copy link

I am getting off the Python ride because of endless churn

Yeah, Python is really confusing and changes a LOT. 🤕

For a "simple" language it's surprisingly difficult. I'm currently trying to learn Rust.

I might be able to whip up a quick script to fix all the instances, but no promises.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants