Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaZagne 2.4.3 [Linux]: AttributeError: 'list' object has no attribute 'items' #428

Closed
linxon opened this issue Sep 20, 2019 · 4 comments
Closed

Comments

@linxon
Copy link

linxon commented Sep 20, 2019

can you help me?

lazagne-2.4.3
python-3.6.5

linxon@minako-chan /tmp/linxon-tmp-files $ lazagne browsers

|====================================================================|
|                                                                    |
|                        The LaZagne Project                         |
|                                                                    |
|                          ! BANG BANG !                             |
|                                                                    |
|====================================================================|

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.6/lazagne", line 212, in <module>
    for run in runLaZagne(category, subcategories):
  File "/usr/lib/python-exec/python3.6/lazagne", line 95, in runLaZagne
    for pwd_dic in run_lazagne(category_selected=category_selected, subcategories=subcategories):
  File "/usr/lib64/python3.6/site-packages/lazagne/config/run.py", line 82, in run_lazagne
    for r in run_modules(category_selected, subcategories):
  File "/usr/lib64/python3.6/site-packages/lazagne/config/run.py", line 67, in run_modules
    for cat in OrderedDict(reversed(sorted(categories.items(), key=lambda t: t[0]))):
AttributeError: 'list' object has no attribute 'items'
@linxon linxon changed the title LaZagne Linux: AttributeError: 'list' object has no attribute 'items' LaZagne 2.4.3 [Linux]: AttributeError: 'list' object has no attribute 'items' Sep 20, 2019
@ghost
Copy link

ghost commented Sep 22, 2019

This only appears when running a specific module, when running 'all` it runs fine.

It is likely caused by #424. I don't have time right now to investigate further, but I'll try to get to it in the next couple of days.

@trossets
Copy link

Hi,
As I had the same issue I looked quickly at the code. I think the problem comes from the following line in file Linux/lazagne/config/run.py :
categories = [category_selected] if category_selected != 'all' else get_categories()
When running a specific module, the variable category_selected is different from 'all' and then categories is assigned a list value but categories should be a dictionary value.
This could be fixed with the following patch:
categories = {category_selected: get_categories()[category_selected]} if category_selected != 'all' else get_categories()
But in my case (category_selected == 'browers') I was missing also the 'wallet' category to make it work (needed to initialize constant.chrome_storage).

@ghost
Copy link

ghost commented Sep 24, 2019

@trossets Thank you for finding the cause of the issue. Changing [category_selected] to a dict fixes the issue.

@AlessandroZ what is the best way to fix this?

@AlessandroZ
Copy link
Owner

Thanks @trossets for your fix 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants