Installing from portage fails

Any hits how to make portage working again?

# emerge -au @my_set
/usr/lib/python3.7/site-packages/portage/package/ebuild/_config/KeywordsManager.py:70: UserWarning: /etc/portage/package.keywords is deprecated, use /etc/portage/package.accept_keywords instead
  UserWarning)

These are the packages that would be merged, in order:

Calculating dependencies \Exception in callback AsynchronousTask.wait()
handle: <Handle AsynchronousTask.wait()>
Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.7/site-packages/_emerge/AsynchronousTask.py", line 84, in wait
    self._wait_hook()
  File "/usr/lib/python3.7/site-packages/_emerge/AsynchronousTask.py", line 195, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib/python3.7/site-packages/portage/util/_async/AsyncScheduler.py", line 80, in _task_exit
    self._schedule()
  File "/usr/lib/python3.7/site-packages/_emerge/PollScheduler.py", line 154, in _schedule
    self._schedule_tasks()
  File "/usr/lib/python3.7/site-packages/portage/util/_async/AsyncScheduler.py", line 66, in _schedule_tasks
    task.start()
  File "/usr/lib/python3.7/site-packages/_emerge/AsynchronousTask.py", line 30, in start
    self._start()
  File "/usr/lib/python3.7/site-packages/_emerge/EbuildMetadataPhase.py", line 59, in _start
    self._async_wait()
  File "/usr/lib/python3.7/site-packages/_emerge/AbstractPollTask.py", line 99, in _async_wait
    self._unregister()
  File "/usr/lib/python3.7/site-packages/_emerge/EbuildMetadataPhase.py", line 147, in _unregister
    self.scheduler.remove_reader(self._files.ebuild)
AttributeError: 'NoneType' object has no attribute 'ebuild'
--Return--
> /usr/lib/python3.7/site-packages/portage/util/_eventloop/asyncio_event_loop.py(81)_internal_caller_exception_handler()->None
-> pdb.set_trace()
(Pdb) 

portage installed:

# equo query belongs $(which emerge)
╠  @@ Belong Search
╠      @@ Package: sys-apps/portage-2.3.89-r3 branch: 5, [__system__] 
╠          Installed:     version: 2.3.89-r3 ~ tag: NoTag ~ revision: 2
╠          Slot:          0
╠          Homepage:      https://wiki.gentoo.org/wiki/Project:Portage 
╠          Description:   Portage is the package management 
╠                         and distribution system for Gentoo 
╠          License:       GPL-2
╠   Keyword:  /usr/bin/emerge
╠   Found:    1 entry

Sorry to give the bad news, but won’t be possible anymore in Sabayon unless somebody forks it and develops it.

I thought Sabayon will be maintained until Mocaccino is production ready. @joost_op?

Ah, now I see

╠ [0] [Wed, 21 Jul 2021 20:09:17 +0000] Title: Entropy repositories deprecation/frozen.
╠ Content:

We have come to the point where we no longer can maintain the Sabayon repositories.
Current repos will be available to you until further notice.
But this kind of means that this is the end!
We would like to thank our community it has been a great ride!
The Sabayon team.
We are continuing our work here: mocaccino.org

╠ Link: http://www.sabayon.org/

So long and thanks for all the fish then!

Upstream Portage3 devs have apparently solved this issue and I’ve copied a 1-line change from them that allowed a build to succeed on my system.

:warning: Caveat: I’m no python developer, so it’s possible this change might cause other problems elsewhere. Try at your own risk.

In File “/usr/lib/python3.7/site-packages/_emerge/EbuildMetadataPhase.py”, line 146, change the _unregister function to read:

    def _unregister(self):
            if self._files is not None:
                    self.scheduler.remove_reader(self._files.ebuild)
            SubProcess._unregister(self)

If you’re a new to Python, be aware that white space matters. Keep the columns aligned as they are shown above.

You should adjust the file location according to which python interpreter is in use on your system. It should be the first version listed by an ‘eselect python list’ command.