Bug 1285636

Summary: [abrt] beets: queryparse.py:136:construct_sort_part:AssertionError: field is missing
Product: [Fedora] Fedora Reporter: 汪明衡 <ifoolb>
Component: beetsAssignee: Michele Baldessari <michele>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: michele
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/cb82f39d0e1a5471b77dbeeca7adb8a2e8212c2f
Whiteboard: abrt_hash:cfa22ad03e70c71796dbd75c8da625a9431a68ae;VARIANT_ID=workstation;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-26 10:42:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description 汪明衡 2015-11-26 06:33:50 UTC
Description of problem:
$ beet remove -a Ashram - Ashram

Version-Release number of selected component:
beets-1.3.13-2.fc22

Additional info:
reporter:       libreport-2.6.3
cmdline:        /usr/bin/python2 /usr/bin/beet remove -a Ashram - Ashram
executable:     /usr/bin/beet
kernel:         4.2.6-200.fc22.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
queryparse.py:136:construct_sort_part:AssertionError: field is missing

Traceback (most recent call last):
  File "/usr/bin/beet", line 9, in <module>
    load_entry_point('beets==1.3.13', 'console_scripts', 'beet')()
  File "/usr/lib/python2.7/site-packages/beets/ui/__init__.py", line 1104, in main
    _raw_main(args)
  File "/usr/lib/python2.7/site-packages/beets/ui/__init__.py", line 1094, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/lib/python2.7/site-packages/beets/ui/commands.py", line 1143, in remove_func
    remove_items(lib, decargs(args), opts.album, opts.delete)
  File "/usr/lib/python2.7/site-packages/beets/ui/commands.py", line 1116, in remove_items
    items, albums = _do_query(lib, query, album)
  File "/usr/lib/python2.7/site-packages/beets/ui/commands.py", line 60, in _do_query
    albums = list(lib.albums(query))
  File "/usr/lib/python2.7/site-packages/beets/library.py", line 1256, in albums
    return self._fetch(Album, query, sort or self.get_default_album_sort())
  File "/usr/lib/python2.7/site-packages/beets/library.py", line 1226, in _fetch
    query, parsed_sort = parse_query_parts(query, model_cls)
  File "/usr/lib/python2.7/site-packages/beets/library.py", line 1124, in parse_query_parts
    model_cls, non_path_parts, prefixes
  File "/usr/lib/python2.7/site-packages/beets/dbcore/queryparse.py", line 198, in parse_sorted_query
    s = sort_from_strings(model_cls, sort_parts)
  File "/usr/lib/python2.7/site-packages/beets/dbcore/queryparse.py", line 159, in sort_from_strings
    sort = construct_sort_part(model_cls, sort_parts[0])
  File "/usr/lib/python2.7/site-packages/beets/dbcore/queryparse.py", line 136, in construct_sort_part
    assert field, "field is missing"
AssertionError: field is missing

Local variables in innermost frame:
field: u''
part: u'-'
model_cls: <class 'beets.library.Album'>

Comment 1 汪明衡 2015-11-26 06:33:57 UTC
Created attachment 1099147 [details]
File: backtrace

Comment 2 汪明衡 2015-11-26 06:34:00 UTC
Created attachment 1099148 [details]
File: environ

Comment 3 汪明衡 2015-11-26 06:38:59 UTC
My typo, I meant to enter '--' as I recalled that - needs to be -- at shell. By the way, how to match only the exact album which is named after the band? I can't find a way to do that.

Comment 4 Michele Baldessari 2015-11-26 10:26:53 UTC
This will be fixed in 1.3.15 (see https://github.com/sampsyo/beets/issues/1605)