I am getting an error using DatePicker in Bokeh 0.12.[0-1] using Chrome on Windows 8.1. I input a date by clicking on the DatetimePicker drop down, but there is time and timezone information appended. The specific issue is that timezone name in the string. The DatePicker works with Chrome on Mac OS X.
value = dateutil.parser.parse(value.split(’ (’)[0]).date() is one possible (ugly) solution.
Full stack trace on the error:
2016-08-12 19:33:50,900 error handling message Message ‘PATCH-DOC’ (revision 1): ValueError(‘Unknown string format’,)
2016-08-12 19:33:50,900 message header {‘msgtype’: ‘PATCH-DOC’, ‘msgid’: ‘372FC5659B9249D8B6DDA86903FE4060’} content {‘events’: [{‘attr’: ‘value’, ‘model’: {‘type’: ‘DatePicker’, ‘id’: ‘bd1f4924-019b-40bc-9c66-218394884b3a’}, ‘new’: ‘Mon Aug 01 2016 00:00:00 GMT-0400 (Eastern Daylight Time)’, ‘kind’: ‘ModelChanged’}], ‘references’: }
Traceback (most recent call last):
File “/opt/conda/lib/python3.5/site-packages/bokeh/server/protocol/server_handler.py”, line 38, in handle
work = yield handler(message, connection)
File “/opt/conda/lib/python3.5/site-packages/tornado/gen.py”, line 1008, in run
value = future.result()
File “/opt/conda/lib/python3.5/site-packages/tornado/concurrent.py”, line 232, in result
raise_exc_info(self._exc_info)
File “”, line 3, in raise_exc_info
File “/opt/conda/lib/python3.5/site-packages/tornado/gen.py”, line 1017, in run
yielded = self.gen.send(value)
File “/opt/conda/lib/python3.5/site-packages/bokeh/server/session.py”, line 45, in _needs_document_lock_wrapper
result = yield yield_for_all_futures(func(self, *args, **kwargs))
File “/opt/conda/lib/python3.5/site-packages/bokeh/server/session.py”, line 217, in _handle_patch
message.apply_to_document(self.document)
File “/opt/conda/lib/python3.5/site-packages/bokeh/server/protocol/messages/patch_doc.py”, line 92, in apply_to_document
doc.apply_json_patch(self.content)
File “/opt/conda/lib/python3.5/site-packages/bokeh/document.py”, line 955, in apply_json_patch
patched_obj.set_from_json(attr, value, models=references)
File “/opt/conda/lib/python3.5/site-packages/bokeh/core/properties.py”, line 735, in set_from_json
prop.set_from_json(self, json, models)
File “/opt/conda/lib/python3.5/site-packages/bokeh/core/properties.py”, line 371, in set_from_json
models)
File “/opt/conda/lib/python3.5/site-packages/bokeh/core/properties.py”, line 323, in set_from_json
return self.__set__(obj, json)
File “/opt/conda/lib/python3.5/site-packages/bokeh/core/properties.py”, line 455, in set
value = self.descriptor.prepare_value(obj.__class__, self.name, value)
File “/opt/conda/lib/python3.5/site-packages/bokeh/core/properties.py”, line 274, in prepare_value
value = self.transform(value)
File “/opt/conda/lib/python3.5/site-packages/bokeh/core/properties.py”, line 1529, in transform
value = dateutil.parser.parse(value).date()
File “/opt/conda/lib/python3.5/site-packages/dateutil/parser.py”, line 1164, in parse
return DEFAULTPARSER.parse(timestr, **kwargs)
File “/opt/conda/lib/python3.5/site-packages/dateutil/parser.py”, line 555, in parse
raise ValueError("Unknown string format")
ValueError: Unknown string format