When I run repoman/emerge with the master-branch of portage, an Error occured: ``` Traceback (most recent call last): File "/usr/bin/repoman", line 38, in <module> import portage File "/usr/local/lib/python3.8/dist-packages/portage/__init__.py", line 133, in <module> import portage.const File "/usr/local/lib/python3.8/dist-packages/portage/const.py", line 64 os.sep, os.sep.join(os.path.realpath(__file__.rstrip("co")).split(os.sep)[:-3]) ^ IndentationError: unexpected indent ``` python3.9 has the same error. not test with python3.10 I tested it on Ubuntu20.04 (Github action and Azure VM) Reproducible: Always Steps to Reproduce: 1. git clone https://github.com/gentoo/portage.git 2. cd portage 3. ./setup.py install 4. emerge --version
I am unable to reproduce this on Gentoo using Python 3.9.7 or Python 3.10.0rc2.
I was testing from a git checkout directly. I can reproduce the issue when I install sys-apps/portage-9999. Perhaps it is related to something setup.py is doing when it builds/installs the code.
Something is changing const.py during installation. In git, we have: > PORTAGE_BASE_PATH = os.path.join( > os.sep, os.sep.join(os.path.realpath(__file__.rstrip("co")).split(os.sep)[:-3]) > ) Once installed, it becomes this: > PORTAGE_BASE_PATH = '/usr/lib/portage' > os.sep, os.sep.join(os.path.realpath(__file__.rstrip("co")).split(os.sep)[:-3]) > )
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=65d90714ab5dd00fa162695181958749dbddb711 commit 65d90714ab5dd00fa162695181958749dbddb711 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2021-09-20 19:53:05 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2021-09-20 19:53:05 +0000 Define PORTAGE_BASE_PATH on a single line This is required for the mangling code in setup.py to work properly. Closes: https://bugs.gentoo.org/814113 Signed-off-by: Mike Gilbert <floppym@gentoo.org> lib/portage/const.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=016d5a48d230123f662f3da4ae7d900d365582aa commit 016d5a48d230123f662f3da4ae7d900d365582aa Author: Wolfgang E. Sanyer <WolfgangESanyer@gmail.com> AuthorDate: 2021-09-20 18:11:07 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2021-09-20 20:05:49 +0000 Fix installation issue related to black formatting and regex Bug: https://bugs.gentoo.org/814113 Closes: https://github.com/gentoo/portage/pull/749 Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer@gmail.com> Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/portage/const.py | 2 ++ 1 file changed, 2 insertions(+)