Skip to content

ValueError: The future belongs to a different loop than the one specified as the loop argument #121

Closed
@oliver-zehentleitner

Description

@oliver-zehentleitner

Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])

  • [ x] I have searched for other issues with the same problem or similar feature requests.

Select one:

  • [ x] Bug
  • Feature Request
  • Technical Help
  • Other

Environment

  • Are you using the module on a VPS or other Cloud hosting?
  • Are you using the module on a Raspberry Pi?

What kind of internet connection do you have?

Average system load (CPU)

Hardware specification

Operating System? (include version)

  • [ x] macOS
  • Windows
  • Linux (include flavour)

Options

  • [x ] stream_buffer
  • process_stream_data

Python Version Requirement

  • [x ] I am using Python 3.6.1 or above

Exact Python Version?

3.8.5

Pip Version?

Dependencies

UNICORN Binance WebSocket API Version?

Description of your issue

Exception in thread Thread-75:
Traceback (most recent call last):
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py",
line 932, in _bootstrap_inner
    self.run()
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py",
line 870, in run
    self._target(*self._args, **self._kwargs)
  File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py",
line 401, in _create_stream_thread
    loop.run_until_complete(socket.start_socket())
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py",
line 616, in run_until_complete
    return future.result()
  File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_socket.py",
line 109, in start_socket
    received_stream_data_json = await websocket.receive()
  File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py",
line 251, in receive
    received_data_json = await
self.manager.websocket_list[self.stream_id].recv()
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/websockets/protocol.py",
line 492, in recv
    await asyncio.wait(
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/tasks.py",
line 424, in wait
    fs = {ensure_future(f, loop=loop) for f in set(fs)}
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/tasks.py",
line 424, in <setcomp>
    fs = {ensure_future(f, loop=loop) for f in set(fs)}
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/tasks.py",
line 667, in ensure_future
    raise ValueError('The future belongs to a different loop than '
ValueError: The future belongs to a different loop than the one
specified as the loop argument

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions