codetree doesn't handle badly formed options in URLs

Bug #1612233 reported by Tom Haddon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
codetree
Fix Released
Undecided
Tim Kuhlman

Bug Description

If you have a URL that you're passing to codetree such as:

postgresql cs:postgresql?overwrite

You get a traceback as follows:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/codetree/config.py", line 92, in __init__
    lineno=fileinput.filelineno())
  File "/usr/lib/python2.7/dist-packages/codetree/config.py", line 24, in from_raw_line
    url, D.source_options = cls.parse_source(source)
  File "/usr/lib/python2.7/dist-packages/codetree/config.py", line 35, in parse_source
    options.update(dict((opt.split("="),)))
ValueError: dictionary update sequence element #0 has length 1; 2 is required

Codetree should give a more informative error, highlighting the line it's having problems parsing.

Related branches

Tim Kuhlman (timkuhlman)
Changed in codetree:
status: New → In Progress
assignee: nobody → Tim Kuhlman (timkuhlman)
Revision history for this message
Tim Kuhlman (timkuhlman) wrote :

Note that the line 'postgresql cs:postgresql?overwrite' actually creates a different error as it tries to send that to the charm store. The error above is from 'postgresql cs:postgresql;overwrite'

Tom Haddon (mthaddon)
Changed in codetree:
status: In Progress → Fix Committed
Tom Haddon (mthaddon)
Changed in codetree:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.