All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [bitbake-devel] [master][dunfell] prserv/serv: Avoid exception with newer versions of Python
       [not found] <1615B08CE92C4E2B.32071@lists.openembedded.org>
@ 2020-06-05 15:55 ` Peter Kjellerstedt
  2020-06-05 17:01   ` Martin Jansa
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Kjellerstedt @ 2020-06-05 15:55 UTC (permalink / raw)
  To: bitbake-devel

> -----Original Message-----
> From: bitbake-devel@lists.openembedded.org <bitbake-devel@lists.openembedded.org> On Behalf Of Peter Kjellerstedt
> Sent: den 5 juni 2020 17:49
> To: bitbake-devel@lists.openembedded.org
> Subject: [bitbake-devel] [master][dunfell] prserv/serv: Avoid exception with newer versions of Python
> 
> 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: fix do_package with 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 <peter.kjellerstedt@axis.com>
> ---
>  bitbake/lib/prserv/serv.py | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
> index 25dcf8a0ee..48f4b5b05d 100644
> --- a/bitbake/lib/prserv/serv.py
> +++ b/bitbake/lib/prserv/serv.py
> @@ -2,6 +2,12 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  #
> 
> +# 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bitbake-devel] [master][dunfell] prserv/serv: Avoid exception with newer versions of Python
  2020-06-05 15:55 ` [bitbake-devel] [master][dunfell] prserv/serv: Avoid exception with newer versions of Python Peter Kjellerstedt
@ 2020-06-05 17:01   ` Martin Jansa
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Jansa @ 2020-06-05 17:01 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 2194 bytes --]

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.

On Fri, Jun 5, 2020 at 5:56 PM Peter Kjellerstedt <
peter.kjellerstedt@axis.com> wrote:

> > -----Original Message-----
> > From: bitbake-devel@lists.openembedded.org <
> bitbake-devel@lists.openembedded.org> On Behalf Of Peter Kjellerstedt
> > Sent: den 5 juni 2020 17:49
> > To: bitbake-devel@lists.openembedded.org
> > Subject: [bitbake-devel] [master][dunfell] prserv/serv: Avoid exception
> with newer versions of Python
> >
> > 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: fix do_package with 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 <peter.kjellerstedt@axis.com>
> > ---
> >  bitbake/lib/prserv/serv.py | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
> > index 25dcf8a0ee..48f4b5b05d 100644
> > --- a/bitbake/lib/prserv/serv.py
> > +++ b/bitbake/lib/prserv/serv.py
> > @@ -2,6 +2,12 @@
> >  # SPDX-License-Identifier: GPL-2.0-only
> >  #
> >
> > +# 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
>
> 
>

[-- Attachment #2: Type: text/html, Size: 3040 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-05 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1615B08CE92C4E2B.32071@lists.openembedded.org>
2020-06-05 15:55 ` [bitbake-devel] [master][dunfell] prserv/serv: Avoid exception with newer versions of Python Peter Kjellerstedt
2020-06-05 17:01   ` Martin Jansa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.