-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Support for Windows #6
Comments
From my testing on windows I found the following:
When i looked into this a little more, it seems there are compatibility issues with the asyncio library See asyncio documentation on compatibility Additionally here is an old but seemingly related github ticket. Although they are not having the exact same issue as us, there are some people in this thread that seem much more knowledgeable than me about asyncio discussing its compatibility issues with windows. Note that this thread, despite still being open, is from 2016, and asyncio has likely changed a bit since then. Despite it not working, it is also worth mentioning This stack overflow thread regarding someone getting the same winerror 6, although it is seemingly under different circumstances. I attempted the recommended fix of adding I was unable to find anyone who had a solution/alternative for these issues (via a quick google search and some chatting with chatGPT), but I am also not super familiar with asyncio, so that doesn't necessarily mean they don't exist. |
I did a little more digging into the asyncio documentation on event loops based on this particular section of the error It seems asyncio uses a completely different event loop implementation (by default) for windows and mac. Windows uses a Proactor event loop that uses I/O Completion Ports, while Unix uses the Selector Event loop based on the selector module. It is worth noting that the selector event loop is compatible with BOTH Windows and Unix. except by default asyncio will use the proactor event loop on windows over the selector event loop. The documentation also gives this snippet of code to manually configure the exact selector implementation to be used:
I transferred this code into
This one I understand a lot more, than the previous one. It seems like in line with the compatibility documentation from my last comment, specifically this section So, it seems like it is possible for the program to work with windows, HOWEVER, this would require us to make a version of the code that is built to be used with a proactor event loop (i think? if that seems reasonable). (Apologies for the long winded comments) |
The issue with selectors is that they have limited functionality on Windows:
I think the error is triggered by the sender reading from STDIN: Lines 29 to 62 in 0619a19
So perhaps the solution is to add some extra code to AsyncReader to handle reading from STDIN on Windows. Of course, we should confirm that the issue is indeed caused by this part of the code. To test this, I recommend creating a simple test program based on AsyncReader. For example, you could try printing STDIN to STDOUT using AsyncReader, and see if you get the same error. |
I don't know if you saw the edits for my previous note (I had not seen your reply and figured id just edit instead of making a new note). but it basically just confirmed what your note said. I havent actually tested it yet with AsyncReader, but that seems like it is probably it (and seems much simpler than my idea of making a completely different file for windows users). I found this thread, which I know is coded in C but it seems that STDIN and IOCP do not like each other very much. I will get back to you when I test this a little more thoroughly |
Unit tests fail for various reasons when run on Windows.
Also, I couldn't successfully transfer a file using the GUI.
The text was updated successfully, but these errors were encountered: