summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3/0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2021-10-11 11:40:40 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-14 11:57:38 +0100
commitfae4ba632bc739cdf7369659f9b3bea2dd1cde45 (patch)
tree33742ebcb9c64ca8c868aee818ba1e887d4b3a1e /meta/recipes-devtools/python/python3/0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch
parent11df8c79a70621591b88f769157db278121cd657 (diff)
downloadpoky-fae4ba632bc739cdf7369659f9b3bea2dd1cde45.tar.gz
python3: update 3.9.7 -> 3.10.0
native and target 0001-Lib-sysconfig.py-use-libdir-values-from-configuratio.patch replaced by native-only 0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch which is more reboust against upstream changes, and keeps target code unmodified. This however necessitated adding 0001-sysconfig.py-use-platlibdir-also-for-purelib.patch to avoid hardcoding 'lib' on target builds as libdir. Drop chunk from 0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch as upstream now uses sysconfig directly inside distutils. Add 0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch and 0001-multiprocessing-disable-a-failing-test.patch to address ptest failures. License-Update: copyright years, case corrections. (From OE-Core rev: 72a75043a946f7db01d3ec04c8889e055f542cca) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3/0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch')
-rw-r--r--meta/recipes-devtools/python/python3/0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch b/meta/recipes-devtools/python/python3/0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch
new file mode 100644
index 0000000000..d6aa9501a7
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch
@@ -0,0 +1,49 @@
1From d8521ee967937184eadc59fff1a30740ad181a98 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Thu, 16 Sep 2021 16:35:37 +0200
4Subject: [PATCH] Lib/pty.py: handle stdin I/O errors same way as master I/O
5 errors
6
7reading stdin can throw the same I/O errors as reading from master fd does,
8e.g. when running under Yocto's test harness:
9======================================================================
10ERROR: test_spawn_doesnt_hang (test.test_pty.PtyTest)
11----------------------------------------------------------------------
12Traceback (most recent call last):
13 File "/usr/lib/python3.10/test/test_pty.py", line 316, in test_spawn_doesnt_hang
14 pty.spawn([sys.executable, '-c', 'print("hi there")'])
15 File "/usr/lib/python3.10/pty.py", line 181, in spawn
16 _copy(master_fd, master_read, stdin_read)
17 File "/usr/lib/python3.10/pty.py", line 157, in _copy
18 data = stdin_read(STDIN_FILENO)
19 File "/usr/lib/python3.10/pty.py", line 132, in _read
20 return os.read(fd, 1024)
21OSError: [Errno 5] Input/output error
22
23So let's treat both channels the same.
24
25Upstream-Status: Submitted [https://github.com/python/cpython/pull/28388]
26Signed-off-by: Alexander Kanavin <alex@linutronix.de>
27---
28 Lib/pty.py | 5 ++++-
29 1 file changed, 4 insertions(+), 1 deletion(-)
30
31diff --git a/Lib/pty.py b/Lib/pty.py
32index 8d8ce40df5..35439c6b96 100644
33--- a/Lib/pty.py
34+++ b/Lib/pty.py
35@@ -154,7 +154,10 @@ def _copy(master_fd, master_read=_read, stdin_read=_read):
36 os.write(STDOUT_FILENO, data)
37
38 if STDIN_FILENO in rfds:
39- data = stdin_read(STDIN_FILENO)
40+ try:
41+ data = stdin_read(STDIN_FILENO)
42+ except OSError:
43+ data = b""
44 if not data:
45 fds.remove(STDIN_FILENO)
46 else:
47--
482.20.1
49