prserv/serv: Avoid exception with newer versions of Python
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 27 lines
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Peter Kjellerstedt
Sent: den 5 juni 2020 17:49
To: [email protected]
Subject: [bitbake-devel] [master][dunfell] prserv/serv: Avoid exception with newer versions of PythonThe following exception was received when doing
devtool modify ...:Exception: ModuleNotFoundError: No module named '
_sysconfigdata'This was previously partially solved in OE-Core, in commit
4b26eaf7(prservice.py: fixdo_packagewith newer Python in Ubuntu 20.04). However, that only solved the problem for some cases where prserv was imported. This should solve if for all of them.Signed-off-by Peter Kjellerstedt <[email protected]>--- bitbake/lib/prserv/serv.py | 6 ++++++ 1 file changed, 6 insertions(+)bitbake/lib/prserv/serv.py +0
-0@@ -2,6 +2,12 @@ # SPDX-License-Identifier: GPL-2.0-only #
bitbake/lib/prserv/serv.py line 13
Quoted 10 lines
bitbake/lib/prserv/serv.py +6
-0+# Make sure _PYTHON_SYSCONFIGDATA_NAME is not set in the environment, which may +# happen for recipes that, e.g., inherit python3native, which sets it. Otherwise +# importing from xmlrpc.server fails with "No module named '_sysconfigdata'" +if '_PYTHON_SYSCONFIGDATA_NAME' in os.environ: + del os.environ['_PYTHON_SYSCONFIGDATA_NAME'] + import os,sys,logging import signal, time from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
Without this, I can no longer use devtool with neither master nor Dunfell.
//Peter
Strange, I was seeing this error on my system in those do_package tasks when sending that initial work around, but devtool works for me fine on the same ubuntu 20.04 system.
But if this works better for you, them I'm fine with the revert of my change.
Quoted 50 lines · Peter Kjellerstedt
Quoted 2 lines
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Peter Kjellerstedt
Quoted 3 lines
Sent: den 5 juni 2020 17:49
To: [email protected]
Subject: [bitbake-devel] [master][dunfell] prserv/serv: Avoid exceptionwith newer versions of Python
Quoted 20 lines
The following exception was received when doing
devtool modify ...:Exception: ModuleNotFoundError: No module named '
_sysconfigdata'This was previously partially solved in OE-Core, in commit
4b26eaf7(prservice.py: fixdo_packagewith newer Python in Ubuntu 20.04). However, that only solved the problem for some cases where prserv was imported. This should solve if for all of them.Signed-off-by Peter Kjellerstedt <[email protected]>--- bitbake/lib/prserv/serv.py | 6 ++++++ 1 file changed, 6 insertions(+)bitbake/lib/prserv/serv.py +0
-0bitbake/lib/prserv/serv.py line 5
Quoted 4 lines
bitbake/lib/prserv/serv.py +1
-0@@ -2,6 +2,12 @@ # SPDX-License-Identifier: GPL-2.0-only # +# Make sure _PYTHON_SYSCONFIGDATA_NAME is not set in the environment,which may
bitbake/lib/prserv/serv.py line 6
Quoted 1 line
bitbake/lib/prserv/serv.py +1
-0+# happen for recipes that, e.g., inherit python3native, which sets it.Otherwise
bitbake/lib/prserv/serv.py line 7
Quoted 1 line
bitbake/lib/prserv/serv.py +1
-0+# importing from xmlrpc.server fails with "No module named'
_sysconfigdata'"bitbake/lib/prserv/serv.py line 13
Quoted 6 lines
bitbake/lib/prserv/serv.py +3
-0+if '_PYTHON_SYSCONFIGDATA_NAME' in os.environ: + del os.environ['_PYTHON_SYSCONFIGDATA_NAME'] + import os,sys,logging import signal, time from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandlerWithout this, I can no longer use devtool with neither master nor Dunfell.
//Peter