Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 814113 - sys-apps/portage: [master branch] IndentationError: unexpected indent
Summary: sys-apps/portage: [master branch] IndentationError: unexpected indent
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-20 19:04 UTC by Ryan Tsien
Modified: 2021-09-20 20:06 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 Ryan Tsien 2021-09-20 19:04:36 UTC
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
Comment 1 Mike Gilbert gentoo-dev 2021-09-20 19:31:00 UTC
I am unable to reproduce this on Gentoo using Python 3.9.7 or Python 3.10.0rc2.
Comment 2 Mike Gilbert gentoo-dev 2021-09-20 19:41:10 UTC
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.
Comment 3 Mike Gilbert gentoo-dev 2021-09-20 19:46:33 UTC
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])
> )
Comment 4 Larry the Git Cow gentoo-dev 2021-09-20 19:55:06 UTC
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(-)
Comment 5 Larry the Git Cow gentoo-dev 2021-09-20 20:06:58 UTC
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(+)