Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 736912 - sys-apps/portage: ModuleNotFoundError: No module named 'pyexpat'
Summary: sys-apps/portage: ModuleNotFoundError: No module named 'pyexpat'
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks: 733180
  Show dependency tree
 
Reported: 2020-08-12 19:58 UTC by Zac Medico
Modified: 2020-08-13 05:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2020-08-12 19:58:38 UTC
In order to avoid failing if there's a problem with xml support in python, we need to handle ImportError when importing xml.parsers.expat. The previous handling was removed here:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=935c47d972d986f1822850618442c19c97e300c3

It results in this error if xml support is missing:

> Traceback (most recent call last):
>   File "/usr/lib/python-exec/python3.7/portageq", line 1227, in <module>
>     commands = sorted(k for k, v in globals().items() \
>   File "/usr/lib/python-exec/python3.7/portageq", line 1228, in <genexpr>
>     if k not in non_commands and isinstance(v, types.FunctionType) and v.__module__ == "__main__")
>   File "/usr/lib/python3.7/site-packages/portage/proxy/objectproxy.py", line 21, in __getattribute__
>     result = object.__getattribute__(self, '_get_target')()
>   File "/usr/lib/python3.7/site-packages/portage/proxy/lazyimport.py", line 127, in _get_target
>     __import__(name)
>   File "/usr/lib/python3.7/site-packages/portage/xml/metadata.py", line 37, in <module>
>     from xml.parsers.expat import ExpatError
>   File "/usr/lib/python3.7/xml/parsers/expat.py", line 4, in <module>
>     from pyexpat import *
> ModuleNotFoundError: No module named 'pyexpat'
Comment 1 Larry the Git Cow gentoo-dev 2020-08-13 04:00:31 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b263754b766b509b59de39106371c002317897b

commit 0b263754b766b509b59de39106371c002317897b
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-08-13 03:51:20 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-08-13 04:00:23 +0000

    sys-apps/portage: 3.0.2-r1 revbump for bug 736912
    
     #736912 Tolerate broken or missing xml support in python
    
    Bug: https://bugs.gentoo.org/733180
    Bug: https://bugs.gentoo.org/736912
    Package-Manager: Portage-3.0.2, Repoman-2.3.23
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/{portage-3.0.2.ebuild => portage-3.0.2-r1.ebuild} | 3 +++
 1 file changed, 3 insertions(+)
Comment 2 Larry the Git Cow gentoo-dev 2020-08-13 04:01:12 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=7d891b78ec906bbd73a43d83abd296350678f002

commit 7d891b78ec906bbd73a43d83abd296350678f002
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-08-13 03:28:28 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-08-13 03:39:26 +0000

    lib/portage/xml/metadata.py: tolerate xml.parsers.expat import failures (bug 736912)
    
    Tolerate broken or missing xml support in python.
    This reverts a behavior change from commit
    935c47d972d986f1822850618442c19c97e300c3.
    
    Fixes: 935c47d972d9 ("lib/portage/xml/metadata.py: fix ungrouped-imports w/refactor")
    Bug: https://bugs.gentoo.org/736912
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/xml/metadata.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Comment 3 Larry the Git Cow gentoo-dev 2020-08-13 04:52:12 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9758b562abfaa671204c76e0c2721c7deef9794

commit c9758b562abfaa671204c76e0c2721c7deef9794
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-08-13 04:50:17 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-08-13 04:52:06 +0000

    sys-apps/portage: PYTHON_REQ_USE-=xml
    
    Bug: https://bugs.gentoo.org/736912
    Package-Manager: Portage-3.0.2, Repoman-2.3.23
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/portage-3.0.2-r1.ebuild | 2 +-
 sys-apps/portage/portage-9999.ebuild     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Comment 4 Larry the Git Cow gentoo-dev 2020-08-13 05:38:03 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1e57ae60a24a4d1a1fbdf4e3d172cdb0128f0ba

commit c1e57ae60a24a4d1a1fbdf4e3d172cdb0128f0ba
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-08-13 05:36:28 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-08-13 05:37:57 +0000

    sys-apps/portage: PYTHON_REQ_USE-=xml
    
    Bug: https://bugs.gentoo.org/736912
    Package-Manager: Portage-3.0.2, Repoman-2.3.23
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/portage-2.3.103.ebuild   | 2 +-
 sys-apps/portage/portage-2.3.99-r2.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)