Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 405899

Summary: net-mail/queue-repair - /usr/bin/queue-repair.py: AttributeError: 'dict_keys' object has no attribute 'sort'
Product: Gentoo Linux Reporter: Oliver Welter <gentoo>
Component: Current packagesAssignee: Net-Mail Packages <net-mail+disabled>
Status: RESOLVED FIXED    
Severity: normal CC: grknight, montar, patrick, redwolfe
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Fixes issues mentioned by python upgrade guide
queue-repair-0.9.0-r1.patch

Description Oliver Welter 2012-02-26 14:23:06 UTC
The net-mail/queue-repair script is not running on python3. 
I fixed the obvious stuff (octal notation, error excepts) so the script compiles, but now I get this error when executing it:

Traceback (most recent call last):
  File "/usr/bin/queue-repair.py", line 778, in <module>
    main()
  File "/usr/bin/queue-repair.py", line 774, in main
    check_queue(qmaildir, test, force_split, force_bigtodo, create, mathishard)
  File "/usr/bin/queue-repair.py", line 686, in check_queue
    check_dirs(dirs, split, bigtodo)
  File "/usr/bin/queue-repair.py", line 334, in check_dirs
    _dirs.sort()
AttributeError: 'dict_keys' object has no attribute 'sort'

I dont have any idea of python, so perhaps anybody can fix this...

Reproducible: Always

Steps to Reproduce:
1. Switch to python3+
2. Fix Octal Notations and except/raise statements (see patch)
3. Execute /usr/bin/queue-repair.py
Actual Results:  
Traceback (most recent call last):
  File "/usr/bin/queue-repair.py", line 778, in <module>
    main()
  File "/usr/bin/queue-repair.py", line 774, in main
    check_queue(qmaildir, test, force_split, force_bigtodo, create, mathishard)
  File "/usr/bin/queue-repair.py", line 686, in check_queue
    check_dirs(dirs, split, bigtodo)
  File "/usr/bin/queue-repair.py", line 334, in check_dirs
    _dirs.sort()
AttributeError: 'dict_keys' object has no attribute 'sort'

Expected Results:  
work =)
Comment 1 Oliver Welter 2012-02-26 14:25:13 UTC
Created attachment 303339 [details, diff]
Fixes issues mentioned by python upgrade guide
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2012-02-27 01:35:46 UTC
Comment on attachment 303339 [details, diff]
Fixes issues mentioned by python upgrade guide

That's a nice patch for upstream - a nicer (ebuild) patch would simply set the required python version as a runtime dependency, and also set the proper shebang in the script.
Comment 3 Brian Evans (RETIRED) gentoo-dev 2014-02-12 21:32:48 UTC
Created attachment 370248 [details, diff]
queue-repair-0.9.0-r1.patch

Patch to use python-single-r1.eclass
Comment 4 Pacho Ramos gentoo-dev 2016-05-06 08:37:33 UTC
I would say... go ahead and fix this finally :/

Thanks
Comment 5 Pacho Ramos gentoo-dev 2016-05-06 08:37:51 UTC
*** Bug 415929 has been marked as a duplicate of this bug. ***
Comment 6 Pacho Ramos gentoo-dev 2016-05-06 08:45:22 UTC
*** Bug 435334 has been marked as a duplicate of this bug. ***
Comment 7 Pacho Ramos gentoo-dev 2016-05-06 08:48:19 UTC
*** Bug 514096 has been marked as a duplicate of this bug. ***
Comment 8 Brian Evans (RETIRED) gentoo-dev 2016-05-06 13:40:25 UTC
Committed queue-repair-0.9.0-r1