python-trio / trio

Trio – a friendly Python library for async concurrency and I/O
https://trio.readthedocs.io
Other
6.06k stars 330 forks source link

Trio does not work with PyPy3 on Windows #1361

Open agronholm opened 4 years ago

agronholm commented 4 years ago

Apparently on pypy3+Windows, most trio functions raise NotImplementedError: signal.set_wakeup_fd is not implemented on Windows. Either somebody has to add that to pypy, or trio has to work around the limitation.

njsmith commented 4 years ago

Have you tried commenting out the set_wakeup_fd code and seeing how far the test suite gets then? If there's just this one issue then that's pretty simple to work around or pressure to get fixed upstream; if this is just one of a dozen different problems then it's a bit different.

On Thu, Jan 9, 2020, 12:25 Alex Grönholm notifications@github.com wrote:

Apparently on pypy3+Windows, most trio functions raise NotImplementedError: signal.set_wakeup_fd is not implemented on Windows. Either somebody has to add that to pypy, or trio has to work around the limitation.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/python-trio/trio/issues/1361?email_source=notifications&email_token=AAEU42G2O6GOBCKVT4QMDD3Q46BZ5A5CNFSM4KE56WL2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IFFITMQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEU42GVXZECNDNV4MEX2S3Q46BZ5ANCNFSM4KE56WLQ .

agronholm commented 4 years ago

I have not. From what you said, it seemed like a crucial part of Trio's event loop. But, I will comment it out and see what happens.

njsmith commented 4 years ago

On Windows, set_wakeup_fd is necessary for control-C handling to work right, which is a pretty serious bug. But, it shouldn't affect anything else, so it should still be possible to check if everything else is working.

agronholm commented 4 years ago

AnyIO's test suite passes completely on this combination when I replace the contents of wakeup_on_signals() with a single yield.

agronholm commented 4 years ago

So the quick and dirty "fix" would be to check for the existence of the signal.wakeup_on_fd function and skip its use if it doesn't exist.

agronholm commented 4 years ago

Now that I've done practical tests on Windows, I've found that on PyPy, ctrl+c and ctrl+break work even without set_wakeup_fd() so it can be safely skipped.

A5rocks commented 4 years ago

For what it's worth, I ran into this too (though the suggested fix of replacing wakeup_on_signals with yield worked).

For anyone in the future, it seems (from my following of links) that this has been resolved in pypy, so upgrading your version past 7.3.1 (if it's been released yet) should fix this. Note that I haven't tested this is actually true...