meltano / edk

Meltano extension development kit
https://edk.meltano.com
Apache License 2.0
10 stars 4 forks source link

fix: If running in Windows, do not use add_signal_handler() #274

Closed joshua-janicas closed 3 months ago

joshua-janicas commented 3 months ago

What is the issue?

image

What was changed?

Example

1) Attempting to run development in Windows with loop.add_signal_handler image

2) == to != for win32 check image

3) Checking KeyboardInterrupt works image

Other notes

We may also be able to set an event loop policy around if the platform we are running on is in Windows - before we get the event loop afterwards. However like I mentioned above my Python knowledge is limited, especially with how async/event loops are managed. I don't think it's a good idea to introduce it but I did want to mention I took a look anyways.

        # If running in windows, set event loop policy instead
        if sys.platform == 'win32':
            asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
            loop = asyncio.ProactorEventLoop()
            asyncio.set_event_loop(loop)

📚 Documentation preview 📚: https://meltano-edk--274.org.readthedocs.build/en/274/

WillDaSilva commented 2 months ago

@joshua-janicas This fix has been published in https://github.com/meltano/edk/releases/tag/v0.4.2