Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 541198 - portage.dep.use_reduce() with custom token_class: Potential TypeError
Summary: portage.dep.use_reduce() with custom token_class: Potential TypeError
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 484436
  Show dependency tree
 
Reported: 2015-02-24 04:16 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2015-03-04 21:47 UTC (History)
1 user (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 Arfrever Frehtes Taifersar Arahesis 2015-02-24 04:16:47 UTC
$ python -c $'import portage\ndef reduce_atom(atom, eapi, is_valid_flag): return None\nprint(portage.dep.use_reduce("a/a b/b"))'
['a/a', 'b/b']
$ python -c $'import portage\ndef reduce_atom(atom, eapi, is_valid_flag): return None\nprint(portage.dep.use_reduce("a/a b/b", token_class=reduce_atom))'
[None, None]
$ python -c $'import portage\ndef reduce_atom(atom, eapi, is_valid_flag): return None\nprint(portage.dep.use_reduce("a/a ( b/b )"))'
['a/a', 'b/b']
$ python -c $'import portage\ndef reduce_atom(atom, eapi, is_valid_flag): return None\nprint(portage.dep.use_reduce("a/a ( b/b )", token_class=reduce_atom))'
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/usr/lib64/python3.4/site-packages/portage/dep/__init__.py", line 565, in use_reduce
    elif stack[level][-1][-1] == "?":
TypeError: 'NoneType' object is not subscriptable
Comment 1 Zac Medico gentoo-dev 2015-02-24 05:38:31 UTC
There's a patch in the following branch:

	https://github.com/zmedico/portage/tree/bug_541198

I've posted it for review here:

	http://thread.gmane.org/gmane.linux.gentoo.portage.devel/5272
Comment 2 Zac Medico gentoo-dev 2015-02-24 17:43:55 UTC
This is in the master branch now:

https://github.com/gentoo/portage/commit/0887d95d288226c52c1d5610b514d41a624eadb7
Comment 3 Brian Dolbec gentoo-dev 2015-03-04 21:47:02 UTC
Released in portage-2.2.18