[Python-modules-team] Bug#771936: mpld3.show() does not work
W. Martin Borgert
debacle at debian.org
Wed Dec 3 16:44:54 UTC 2014
Package: python-mpld3
Version: 0.3git+20140910dfsg-2
This example from https://mpld3.github.io/quickstart.html does
not work:
$ python
...
>>> import matplotlib.pyplot as plt, mpld3
>>> plt.plot([3,1,4,1,5], 'ks-', mec='w', mew=5, ms=20)
[<matplotlib.lines.Line2D object at 0x7f62a2358fd0>]
>>> mpld3.show()
Serving to http://127.0.0.1:8888/ [Ctrl-C to exit]
...
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 43978)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 655, in __init__
self.handle()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "/usr/lib/python2.7/dist-packages/mpld3/_server.py", line 48, in do_GET
self.wfile.write(content.encode())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 90014: ordinal not in range(128)
mpld3.fig_to_html() etc. do work fine, however.
Removing the ".encode()" in mpld3/_server.py:48 helps.
More information about the Python-modules-team
mailing list