Skip to content

Conversation

Xmader
Copy link
Member

@Xmader Xmader commented May 25, 2023

https://github.com/Distributive-Network/PythonMonkey/actions/runs/5084218550/jobs/9136227002#step:6:1102


https://docs.python.org/3/whatsnew/3.11.html#porting-to-python-3-11

open(), io.open(), codecs.open() and fileinput.FileInput no longer accept 'U' (“universal newline”) in the file mode. In Python 3, “universal newline” mode is used by default whenever a file is opened in text mode, and the 'U' flag has been deprecated since Python 3.3. The newline parameter to these functions controls how universal newlines work. (Contributed by Victor Stinner in bpo-37330.)

@Xmader
Copy link
Member Author

Xmader commented May 25, 2023

see also: https://github.com/nodejs/node-gyp/issues/2219

@Xmader
Copy link
Member Author

Xmader commented May 25, 2023

https://github.com/Distributive-Network/PythonMonkey/actions/runs/5084446135/jobs/9136751622 doesn't fail because it uses a cached SpiderMonkey built with Python 3.10

@Xmader Xmader requested a review from Hamada-Distributed May 25, 2023 21:16
Copy link

@11mhg 11mhg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@Xmader Xmader merged commit 3336a78 into main May 28, 2023
echo "Building spidermonkey"
cd firefox-102.2.0/python/mozbuild/mozbuild
# the build system breaks on Python 3.11 (`io.open()` no longer accepts 'U' in the file mode)
sed -i 's/"rU"/"r"/g' util.py preprocessor.py action/process_define_files.py backend/base.py
Copy link
Collaborator

@wesgarland wesgarland May 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awfully broad: you're better off with a tighter expression like
sed -i 's/\(io\.open(\)\([^,]*,\)\( *["']rU['"] *\)/\1\2 "r"/g'

sed -i 's/"rU"/"r"/g' util.py preprocessor.py action/process_define_files.py backend/base.py
cd -
cd firefox-102.2.0/js
sed -i 's/bool Unbox/JS_PUBLIC_API bool Unbox/g' ./public/Class.h # need to manually add JS_PUBLIC_API to js::Unbox until it gets fixed in Spidermonkey
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has a bug been filed with Mozilla? It should have been. A link to the bug should be in a comment here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants