"Bug" found in tutorial file that crashes GUI

Hi all! I’m new to Nengo, and am going through the HBB tutorials in the built-in examples folder.

The first one in chapter 3 (hbb_tutorials/chapter3/1-addition.py), however, crashed the GUI server when I tried to open it! It left me with the following long error message.

Full error message

Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/nengo_gui/server.py”, line 412, in do_GET
self.http_GET()
File “/usr/local/lib/python3.7/site-packages/nengo_gui/guibackend.py”, line 137, in http_GET
server.HttpWsRequestHandler.http_GET(self)
File “/usr/local/lib/python3.7/site-packages/nengo_gui/server.py”, line 428, in http_GET
response = getattr(self, command)()
File “/usr/local/lib/python3.7/site-packages/nengo_gui/guibackend.py”, line 86, in auth_checked
return fn(inst)
File “/usr/local/lib/python3.7/site-packages/nengo_gui/guibackend.py”, line 233, in serve_main
page = self.server.create_page(filename, reset_cfg=reset_cfg)
File “/usr/local/lib/python3.7/site-packages/nengo_gui/guibackend.py”, line 457, in create_page
reset_cfg=reset_cfg)
File “/usr/local/lib/python3.7/site-packages/nengo_gui/page.py”, line 118, in init
self.load()
File “/usr/local/lib/python3.7/site-packages/nengo_gui/page.py”, line 165, in load
code = f.read()
File “/usr/local/Cellar/python/3.7.8/Frameworks/Python.framework/Versions/3.7/lib/python3.7/codecs.py”, line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x91 in position 372: invalid start byte

This error message ends with the following:

UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x91 in position 372: invalid start byte

I opened 1-addition.py in an editor, and found what I’m guessing were, at some point in their digital lifetimes, two smartquotes in line 7:

# ... Addition is somewhat ëfreeí, ...

Removing the ë and í fixed the problem.

This is very minor, and for all I know an issue with my system alone, but just letting y’all know in case it helps others who are also just starting out! :slight_smile:

2 Likes

Hi thorimur,

Welcome and good catch! Thanks for pointing that out. The PR with the fix is made and should be merged soon.

Cheers