-
Notifications
You must be signed in to change notification settings - Fork 781
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
Python 3.0 support #1
Comments
Info about using the same code-base for 2.X and 3.X: http://nedbatchelder.com/blog/200910/running_the_same_code_on_python_2x_and_3x.html |
Here is a patch that adds python 3 and multiprocessing support: https://gist.github.com/976972 The patch drops python2.4 support for now although the same code base is able to support python 2.6 on up. However, the code is able to trigger a futex hang in python 3.1 so I'm not pushing it into the main tree until that is resolved. The futex hang can be triggered by reloading the noVNC vnc.html page repeatedly until it stops responding. This hang is not related to the WebSockets code since this is just loading the page without doing any WebSocket connections. stracing the hung python process shows the following: When hung like that the process cannot be interrupted with Ctrl-C and must be killed directly. |
Include @ysangkok |
Okay, I figured out a workaround to the python 3 futex hang. It appears to be related to the fact that websocket.py was doing it's own SIGCHLD child process reaping. The multiprocessing module does it's own SIGCHLD handling so we only have to do SIGCHLD handling when using os.fork() (under python 2.4). Support has been committed with c858711. |
It doesn't work right now because you're importing the "resource" module, which is Unix-only. I believe this is not strictly required though, so it might be easily fixed? |
Instead of doing crazy things with file-descriptors in SplitHTTPHandler, WSRequestHandler detects a WebSockets upgrade and returns 101 as the 'last_code'. In addition to avoiding funkiness with file-descriptors, this allows use of the already parsed headers and removal of the parse_handshake routine. This also makes it easier to explore adding python 3.X support (novnc/websockify#1) since the file-descriptor/string splitting is very difficult to integrate with python 3.X.
Hopefully 2.X and 3 can be supported in the same code-base or at least by a mostly common module.
The text was updated successfully, but these errors were encountered: