-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
ValueError: invalid mode: 'rU' while trying to load binding.gyp (Python 3.9 compatibility issue) #2219
Comments
Please submit a pull request... I think this change would be valuable to Python users. Python 3.9 general release is scheduled for Oct. 5th. |
Please submit any pull requests to https://github.com/nodejs/gyp-next. |
Python recently was updated to 3.11 and the build of the node binding is now failing. (Apparently still using a quite old version of node-gyp, because this was fixed in `https://github.com/nodejs/node-gyp/issues/2219`) ``` File "/home/runner/work/slint/slint/target/debug/build/neon-sys-4b140f4af6e7aeb3/out/native/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 239, in LoadOneBuildFile build_file_contents = open(build_file_path, "rU").read() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid mode: 'rU' while trying to load binding.gyp ```
Python recently was updated to 3.11 and the build of the node binding is now failing. (Apparently still using a quite old version of node-gyp, because this was fixed in `https://github.com/nodejs/node-gyp/issues/2219`) ``` File "/home/runner/work/slint/slint/target/debug/build/neon-sys-4b140f4af6e7aeb3/out/native/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 239, in LoadOneBuildFile build_file_contents = open(build_file_path, "rU").read() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid mode: 'rU' while trying to load binding.gyp ```
I'm seeing this on Windows 11 with Python 3.9 or 3.11. How can we fix it? It seems like it should not occur after the fix of this PR, but it is. |
Looks like the vendored copy of gyp here needs to be updated to gyp-next 0.6.3, and then a new node-gyp release has to be made, and then dependencies have to be updated. |
Actually, vendored gyp is already updated, so maybe just updating node-gyp is enough. |
The |
I can confirm that downgrading python in my conda environment from 3.11.1 to 3.10.8 fixed this problem for me. |
It's already been fixed by nodejs/gyp-next@d0504e6 |
Using Python3.11 and removing the "U" from the function in input.py resolved it for me. |
…#796) * html5-webcam: feat: Update Webcam widget to allow streaming h264(mp4) remote streams * html5-webcam: chore: Bump appveyor nodejs to v14 * html5-webcam: chore: npm@latest on node 14 is broken on Windows * html5-webcam: chore: fix broken node-gyp build on Python 3.11 nodejs/node-gyp#2219 * html5-webcam: chore: attempt to fix broken node-gyp again * html5-webcam: html5-webcam: chore: Escape backslashes in PATH, set PATHoutside PS
I had the same problem with Python3.11, updating Check the comment for the first
|
13.7.0
Verbose output (from npm or node-gyp):
I know that Python 3.9 isn't mentioned on the supported releases and don't ask me why I had it installed in the first place, but I just thought I'd report this since I didn't see it mentioned elsewhere, it looks like the "U" flag when opening a file has been deprecated, this causes the "node-gyp configure" command to fail with the above output. In "input.py" I removed the "U" from the offending function call and it worked fine after that. Please let me know if this has already been discussed.
The text was updated successfully, but these errors were encountered: