Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 231479 - sys-apps/portage-2.1.4.4 - AttributeError: 'NoneType' object has no attribute 'startswith'
Summary: sys-apps/portage-2.1.4.4 - AttributeError: 'NoneType' object has no attribute...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-11 04:20 UTC by Roy
Modified: 2010-04-05 18:06 UTC (History)
2 users (show)

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 Roy 2008-07-11 04:20:02 UTC
After I do emerge -1 portage, emerge became crash. Even if run emerge without any option

Reproducible: Always

Steps to Reproduce:
1.from terminal, run: emerge
2.
3.

Actual Results:  
# emerge
Traceback (most recent call last):
  File "/usr/bin/emerge", line 6831, in ?
    retval = emerge_main()
  File "/usr/bin/emerge", line 6496, in emerge_main
    settings, trees, mtimedb = load_emerge_config()
  File "/usr/bin/emerge", line 6381, in load_emerge_config
    trees = portage.create_trees(trees=trees, **kwargs)
  File "/usr/lib/portage/pym/portage.py", line 6919, in create_trees
    config_incrementals=portage_const.INCREMENTALS)
  File "/usr/lib/portage/pym/portage.py", line 833, in __init__
    config_root = \
  File "/usr/lib/portage/pym/portage_util.py", line 40, in normalize_path
    if mypath.startswith(os.path.sep):
AttributeError: 'NoneType' object has no attribute 'startswith'

Expected Results:  
# emerge
emerge: the other white meat (command-line interface to the Portage system)
Usage:
   emerge [ options ] [ action ] [ ebuildfile | tbz2file | dependency ] [ ... ]
   emerge [ options ] [ action ] < system | world >
   emerge < --sync | --metadata | --info >
   emerge --resume [ --pretend | --ask | --skipfirst ]
   emerge --help [ system | world | --sync ] 
Options: -[abBcCdDefgGhkKlnNoOpqPsStuvV]
          [ --columns   ] [ --deep      ] [ --newuse    ]
          [ --noconfmem ] [ --nospinner ] [ --oneshot   ]
          [ --color < y | n >           ] [ --complete-graph            ]
          [ --reinstall changed-use     ] [ --with-bdeps < y | n >      ]
Actions:  [ --clean | --depclean | --prune | --regen | --search | --unmerge ]

   For more help try 'emerge --help --verbose' or consult the man page.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-07-11 04:32:16 UTC
Please post the output of `emerge --info' too.
Comment 2 Zac Medico gentoo-dev 2008-07-11 05:25:16 UTC
I'm having a hard time deciphering that traceback from comment #0 because all the line numbers appear to be corrupt (they don't seem to match the portage-2.1.4.4 sources if that's what version you have).

You might try upgrading to version 2.1.5 to see if that helps. If emerge won't work, you can try these instructions:

http://www.gentoo.org/proj/en/portage/doc/manually-fixing-portage.xml
Comment 3 Roy 2008-07-11 07:47:30 UTC
Here is the result of emerge --info:

# emerge --info    
Traceback (most recent call last):
  File "/usr/bin/emerge", line 8991, in ?
    retval = emerge_main()
  File "/usr/bin/emerge", line 8648, in emerge_main
    settings, trees, mtimedb = load_emerge_config()
  File "/usr/bin/emerge", line 8528, in load_emerge_config
    trees = portage.create_trees(trees=trees, **kwargs)
  File "/usr/lib/portage/pym/portage.py", line 10462, in create_trees
    config_incrementals=portage_const.INCREMENTALS)
  File "/usr/lib/portage/pym/portage.py", line 1716, in __init__
    self.regenerate()
  File "/usr/lib/portage/pym/portage.py", line 2450, in regenerate
    if mykey not in curdb:
TypeError: list objects are unhashable

P.S. I've tried to manually fixed like on http://www.gentoo.org/proj/en/portage/doc/manually-fixing-portage.xml but it still won't help. I tried with portage-2.1.5
Comment 4 Zac Medico gentoo-dev 2008-07-11 10:16:55 UTC
It seems like maybe python is broken somehow, because these errors aren't making any sense to me. Do you use any other python applications and if so do they work?

One thing you can do is chroot into a stage tarball and run `quickpkg python` and then use tar to manually extract the tbz2 file onto your live system.
Comment 5 Zac Medico gentoo-dev 2008-07-11 20:30:23 UTC
I had a user report a similar nonsensical 'TypeError: unhashable type' exception on irc. He was using python-2.6_beta1-r2 and he said the problem went away after running `eselect python set python2.5`.
Comment 6 Zac Medico gentoo-dev 2008-07-23 03:39:41 UTC
(In reply to comment #5)
> I had a user report a similar nonsensical 'TypeError: unhashable type'
> exception on irc. He was using python-2.6_beta1-r2 and he said the problem went
> away after running `eselect python set python2.5`.

Actually, this appears to be a separate issue since is was due to a documented upstream change in __hash__ inheritance (it's no longer inherited in some cases that it used to be).
Comment 7 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-04-03 21:18:18 UTC
Please test with newer versions.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2010-04-05 18:06:28 UTC
(In reply to comment #7)
> Please test with newer versions.

You mean, when `emerge -1 portage' crashes, you need to emerge a newer portage? :)

I don't agree at all with this resolution, but the bug has been untouched for two years so we might agree that it cannot possibly be verified after all this time. Please research the entire bug report next time.