jakevdp/sklearn_tutorial

UnicodeEncodeError seen during starting 02.2-Basic-Principles.ipynb

shobhitmittal opened this issue · 2 comments

[E 03:25:30.511 NotebookApp] Uncaught exception GET /api/contents/notebooks/02.2-Basic-Principles.ipynb?type=notebook&=1579470930307 (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/contents/notebooks/02.2-Basic-Principles.ipynb?type=notebook&
=1579470930307', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Accept-Language': 'en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7', 'Accept-Encoding': 'gzip, deflate, br', 'X-Xsrftoken': '2|1649b2cc|42b280df55672c38a719ab21acbad7d7|1579468890', 'Sec-Fetch-Site': 'same-origin', 'Host': 'localhost:8888', 'Accept': 'application/json, text/javascript, /; q=0.01', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', 'Dnt': '1', 'Connection': 'keep-alive', 'X-Requested-With': 'XMLHttpRequest', 'Sec-Fetch-Mode': 'cors', 'Referer': 'http://localhost:8888/notebooks/notebooks/02.2-Basic-Principles.ipynb', 'Cookie': '_xsrf=2|1649b2cc|42b280df55672c38a719ab21acbad7d7|1579468890; username-localhost-8888="2|1:0|10:1579468890|23:username-localhost-8888|44:ZjE0MWRlNWVhMTIzNGFlMGI3MGRlOWE2YmJkOGI4OWE=|52c1232bd8aa482e6e27972d6b5b71bf99de9d0f65c84a020774444cd1b115b7"'})
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1511, in _execute
result = yield result
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1055, in run
value = future.result()
File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 307, in wrapper
yielded = next(result)
File "/usr/local/lib/python2.7/dist-packages/notebook/services/contents/handlers.py", line 112, in get
path=path, type=type, format=format, content=content,
File "/usr/local/lib/python2.7/dist-packages/notebook/services/contents/filemanager.py", line 433, in get
model = self._notebook_model(path, content=content)
File "/usr/local/lib/python2.7/dist-packages/notebook/services/contents/filemanager.py", line 392, in _notebook_model
self.mark_trusted_cells(nb, path)
File "/usr/local/lib/python2.7/dist-packages/notebook/services/contents/manager.py", line 503, in mark_trusted_cells
trusted = self.notary.check_signature(nb)
File "/usr/local/lib/python2.7/dist-packages/nbformat/sign.py", line 438, in check_signature
signature = self.compute_signature(nb)
File "/usr/local/lib/python2.7/dist-packages/nbformat/sign.py", line 417, in compute_signature
for b in yield_everything(nb):
File "/usr/local/lib/python2.7/dist-packages/nbformat/sign.py", line 272, in yield_everything
for b in yield_everything(value):
File "/usr/local/lib/python2.7/dist-packages/nbformat/sign.py", line 276, in yield_everything
for b in yield_everything(element):
File "/usr/local/lib/python2.7/dist-packages/nbformat/sign.py", line 272, in yield_everything
for b in yield_everything(value):
File "/usr/local/lib/python2.7/dist-packages/nbformat/sign.py", line 281, in yield_everything
yield str(obj).encode('utf8')
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 118: ordinal not in range(128)
[W 03:25:30.512 NotebookApp] Unhandled error
[E 03:25:30.512 NotebookApp] {
"Accept-Language": "en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7",
"Accept-Encoding": "gzip, deflate, br",
"X-Xsrftoken": "2|1649b2cc|42b280df55672c38a719ab21acbad7d7|1579468890",
"Sec-Fetch-Site": "same-origin",
"Host": "localhost:8888",
"Accept": "application/json, text/javascript, /; q=0.01",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36",
"Dnt": "1",
"Connection": "keep-alive",
"X-Requested-With": "XMLHttpRequest",
"Sec-Fetch-Mode": "cors",
"Referer": "http://localhost:8888/notebooks/notebooks/02.2-Basic-Principles.ipynb",
"Cookie": "xsrf=2|1649b2cc|42b280df55672c38a719ab21acbad7d7|1579468890; username-localhost-8888="2|1:0|10:1579468890|23:username-localhost-8888|44:ZjE0MWRlNWVhMTIzNGFlMGI3MGRlOWE2YmJkOGI4OWE=|52c1232bd8aa482e6e27972d6b5b71bf99de9d0f65c84a020774444cd1b115b7""
}
[E 03:25:30.513 NotebookApp] 500 GET /api/contents/notebooks/02.2-Basic-Principles.ipynb?type=notebook&
=1579470930307 (127.0.0.1) 40.91ms referer=http://localhost:8888/notebooks/notebooks/02.2-Basic-Principles.ipynb

Can you share the notebook link, or the snippet that is failing in your case.

02.2-Basic-Principles.ipynb