summaryrefslogtreecommitdiff
path: root/user/boost/python-311-fix-open.patch
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2022-11-27 11:01:15 -0600
committerZach van Rijn <me@zv.io>2022-11-27 11:06:29 -0600
commit148391a5a9a63785c6daaf6a82eb5bd72ac29272 (patch)
tree62a3eac0bd851f214c91439e51802687ffb4a615 /user/boost/python-311-fix-open.patch
parentc9f86d7a0fdadc3a9b9d290be2e4072610680193 (diff)
downloadpackages-148391a5a9a63785c6daaf6a82eb5bd72ac29272.tar.gz
packages-148391a5a9a63785c6daaf6a82eb5bd72ac29272.tar.bz2
packages-148391a5a9a63785c6daaf6a82eb5bd72ac29272.tar.xz
packages-148391a5a9a63785c6daaf6a82eb5bd72ac29272.zip
user/boost: add patches for python 3.11. fixes #890.
Diffstat (limited to 'user/boost/python-311-fix-open.patch')
-rw-r--r--user/boost/python-311-fix-open.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/user/boost/python-311-fix-open.patch b/user/boost/python-311-fix-open.patch
new file mode 100644
index 000000000..4d238d3a2
--- /dev/null
+++ b/user/boost/python-311-fix-open.patch
@@ -0,0 +1,22 @@
+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.
+
+diff -ur a/tools/build/test/BoostBuild.py b/tools/build/test/BoostBuild.py
+--- a/tools/build/test/BoostBuild.py 2022-11-27 10:51:49.323319793 -0600
++++ b/tools/build/test/BoostBuild.py 2022-11-27 10:52:31.636168392 -0600
+@@ -579,8 +579,6 @@
+ openMode = "r"
+ if binary:
+ openMode += "b"
+- else:
+- openMode += "U"
+ f = open(name, openMode)
+ result = f.read()
+ f.close()