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

open_connection() fails to report connection refused error on OpenBSD #118

Open
sbourdeauducq opened this issue Apr 11, 2024 · 0 comments
Open

Comments

@sbourdeauducq
Copy link

Repro:

import asyncio
import logging

from PyQt5 import QtWidgets
import qasync

logging.basicConfig(level=logging.DEBUG)

app = QtWidgets.QApplication(["test"])
loop = qasync.QEventLoop(app)
asyncio.set_event_loop(loop)
loop.set_debug(True)
loop.run_until_complete(asyncio.open_connection("127.0.0.1", 3251))  # with the port not open

Output:

DEBUG:asyncio:Using selector: _Selector
DEBUG:qasync._QEventLoop:Running <coroutine object open_connection at 0x6dd6e8f69d0> until complete
DEBUG:qasync._QEventLoop:Registering callback <TaskStepMethWrapper object at 0x6dd6e97ddb0> to be invoked with arguments () after 0 second(s)
DEBUG:qasync._SimpleTimer:Registering timer id 1
DEBUG:qasync._QEventLoop:Starting Qt event loop
DEBUG:qasync._SimpleTimer:Timer event on id 1
DEBUG:qasync._SimpleTimer:Calling handle <Handle <TaskStepMethWrapper object at 0x6dd6e97ddb0>() created at /home/sb/qasync/qasync/__init__.py:472>
DEBUG:qasync._QEventLoop:Adding writer callback for file descriptor 24

Runs until killed and uses 100% CPU.

Expected behavior would be something like:

  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 541, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 61] Connect call failed ('127.0.0.1', 3251)

(as occurs with the default asyncio event loop)

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

No branches or pull requests

1 participant