question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DatePicker errors on input from Chrome on Windows 8.1

See original GitHub issue

Using Chrome 52 on Windows 8.1, I find that DatePicker throws an error on any value chosen from the dropdown calendar. For same Chrome version on Mac OS X, I find that it always works.

I am using bokeh 0.12.0-1.

I have a bokeh server with the following code in app/main.py:

from bokeh.io import curdoc
from bokeh.models import DatePicker

curdoc().add_root(DatePicker())

and run with the command

bokeh serve --log-level debug app

The exception is:

2016-08-16 15:16:51,365 error handling message Message 'PATCH-DOC' (revision 1): ValueError('Unknown string format',)
2016-08-16 15:16:51,365   message header {'msgid': '8B5BE6EBF7044F8793268769745D6C7A', 'msgtype': 'PATCH-DOC'} content {'events': [{'new': 'Mon Aug 01 2016 00:00:00 GMT-0400 (Eastern Daylight Time)', 'model': {'type': 'DatePicker', 'id': '5f8ecfc4-a06e-428f-b21d-6ed1a34cefff'}, 'attr': 'value', 'kind': 'ModelChanged'}], 'references': []}
Traceback (most recent call last):
  File "/Users/rheineke/anaconda/lib/python3.5/site-packages/bokeh/server/protocol/server_handler.py", line 38, in handle
    work = yield handler(message, connection)
  File "/Users/rheineke/anaconda/lib/python3.5/site-packages/tornado/gen.py", line 1008, in run
    value = future.result()
  File "/Users/rheineke/anaconda/lib/python3.5/site-packages/tornado/concurrent.py", line 232, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 3, in raise_exc_info
  File "/Users/rheineke/anaconda/lib/python3.5/site-packages/tornado/gen.py", line 1017, in run
    yielded = self.gen.send(value)
  File "/Users/rheineke/anaconda/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 "/Users/rheineke/anaconda/lib/python3.5/site-packages/bokeh/server/session.py", line 217, in _handle_patch
    message.apply_to_document(self.document)
  File "/Users/rheineke/anaconda/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 "/Users/rheineke/anaconda/lib/python3.5/site-packages/bokeh/document.py", line 955, in apply_json_patch
    patched_obj.set_from_json(attr, value, models=references)
  File "/Users/rheineke/anaconda/lib/python3.5/site-packages/bokeh/core/properties.py", line 735, in set_from_json
    prop.set_from_json(self, json, models)
  File "/Users/rheineke/anaconda/lib/python3.5/site-packages/bokeh/core/properties.py", line 371, in set_from_json
    models)
  File "/Users/rheineke/anaconda/lib/python3.5/site-packages/bokeh/core/properties.py", line 323, in set_from_json
    return self.__set__(obj, json)
  File "/Users/rheineke/anaconda/lib/python3.5/site-packages/bokeh/core/properties.py", line 455, in __set__
    value = self.descriptor.prepare_value(obj.__class__, self.name, value)
  File "/Users/rheineke/anaconda/lib/python3.5/site-packages/bokeh/core/properties.py", line 274, in prepare_value
    value = self.transform(value)
  File "/Users/rheineke/anaconda/lib/python3.5/site-packages/bokeh/core/properties.py", line 1529, in transform
    value = dateutil.parser.parse(value).date()
  File "/Users/rheineke/anaconda/lib/python3.5/site-packages/dateutil/parser.py", line 1164, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/Users/rheineke/anaconda/lib/python3.5/site-packages/dateutil/parser.py", line 555, in parse
    raise ValueError("Unknown string format")

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:26 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
volkerjaenischcommented, Oct 9, 2017

@bryevdv I can confirm the findings of @artur-scholz. The problem is in date_picker.coffee.

  _on_select: (date) =>
    @model.value = date.toString()
    @change_input()

Resulting on win10/IE to: "‘Sun Sep 24 2017 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit)’ Fix is easy.

  _on_select: (date) =>
    @model.value = date.toISOString()
    @change_input()

Resulting to: “2017-09-22T22:00:00.00Z”

The former cannot be parsed by dateutil:

>>> value = dateutil.parser.parse('Sun Sep 24 2017 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit)')
Traceback (most recent call last):
  File "/home/volker/workspace/eprofile/lib/python3.5/site-packages/python_dateutil-2.6.1-py3.5.egg/dateutil/parser.py", line 559, in parse
    raise ValueError("Unknown string format")
ValueError: Unknown string format

The later can be parsed.

>>> dateutil.parser.parse('2017-09-22T22:00:00.00Z')
datetime.datetime(2017, 9, 22, 22, 0, tzinfo=tzutc())

@bryevdv Shall I create a PR?

0reactions
bryevdvcommented, Oct 9, 2017

@volkerjaenisch yes please, and thanks for running this down

Read more comments on GitHub >

github_iconTop Results From Across the Web

DatePicker not handling input from Chrome on Windows 8.1 ...
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...
Read more >
Date Picker Not Showing Up when using Chrome
Hi,. I have a date range parameters in my report, and when viewing it using IE and Firefox ReportViewer, the date picker is...
Read more >
DatePicker errors on input from Chrome on Windows 8.1
Using Chrome 52 on Windows 8.1, I find that DatePicker throws an error on any value chosen from the dropdown calendar. For same...
Read more >
Bootstrap Datepicker not working in chrome - Stack Overflow
I'm using version 1.6.0 of the same plugin and it wasn't working in Chrome. For me, the cause was an old version of...
Read more >
input type="date" + jQuery datepicker fails Chrome validation
Issue 86350: input type="date" + jQuery datepicker fails Chrome validation · 1. Create an html form with a "date" input type in it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found