jdunck / google-visualization-python

Automatically exported from code.google.com/p/google-visualization-python
Apache License 2.0
0 stars 1 forks source link

traceback if argument tqx ends semicolon in function toResponse #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
DataTable.ToResponse

In certain cases the argument tqx end with a Semicolon causing the the 
following traceback

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/cherrypy/_cprequest.py", line 645, in respond
    response.body = self.handler()
  File "/usr/lib/python2.6/site-packages/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/cherrypy/_cpdispatch.py", line 29, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/opt/sandbox/IDIPYT/trunk/src/py/_RECVIEW/Ajax.py", line 101, in timeLine
    return table.ToResponse(tqx = tqx)
  File "/usr/local/lib/python2.6/site-packages/gviz_api.py", line 1041, in ToResponse
    tqx_dict = dict(opt.split(":") for opt in tqx.split(";"))
ValueError: dictionary update sequence element #1 has length 1; 2 is required

adding at line 1033 solves the issue
if tqx.endswith(";") :
    tqx = tqx[:-1]

Original issue reported on code.google.com by rudolf.h...@gmail.com on 17 Oct 2011 at 11:15