mirror of
https://github.com/beetbox/beets.git
synced 2025-12-31 21:12:43 +01:00
Handle shlex parse errors in query strings
Provide context: offending query string. Update changelog. Fix #1290.
This commit is contained in:
parent
557330e994
commit
f284d8fad5
2 changed files with 5 additions and 1 deletions
|
|
@ -1069,7 +1069,10 @@ def parse_query_string(s, model_cls):
|
|||
# http://bugs.python.org/issue6988
|
||||
if isinstance(s, unicode):
|
||||
s = s.encode('utf8')
|
||||
parts = [p.decode('utf8') for p in shlex.split(s)]
|
||||
try:
|
||||
parts = [p.decode('utf8') for p in shlex.split(s)]
|
||||
except ValueError as exc:
|
||||
raise ValueError("Cannot parse {0!r} (error was: {1})".format(s, exc))
|
||||
return parse_query_parts(parts, model_cls)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ Fixes:
|
|||
like the bitrate. :bug:`1268`
|
||||
* The error message when MusicBrainz is not reachable on the network is now
|
||||
much clearer. Thanks to Tom Jaspers. :bug:`1190` :bug:`1272`
|
||||
* Improve error messages when parsing query strings with shlex. :bug:`1290`
|
||||
|
||||
For developers:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue