TL, DR: A python file encounters the UnicodeDecodeError when ran in Spyder, but works when I ran it in command line.
I downloaded a Python module that wraps a C implementation of a suffix tree. After built, it was ran in Spyder but I got the following error:
runfile('F:/src/suffix_tree-2.1/build/lib.win32-2.7/suffix_tree.py', wdir='F:/src/suffix_tree-2.1/build/lib.win32-2.7') Traceback (most recent call last):
File "G:\IDE\python\Anaconda\lib\site-packages\IPython\core\interactiveshell.py", line 3052, in run_code self.showtraceback()
File "G:\IDE\python\Anaconda\lib\site-packages\IPython\core\interactiveshell.py", line 1851, in showtraceback value, tb, tb_offset=tb_offset)
File "G:\IDE\python\Anaconda\lib\site-packages\IPython\core\ultratb.py", line 1240, in structured_traceback self, etype, value, tb, tb_offset, number_of_lines_of_context)
File "G:\IDE\python\Anaconda\lib\site-packages\IPython\core\ultratb.py", line 1157, in structured_traceback self, etype, value, elist, tb_offset, number_of_lines_of_context
File "G:\IDE\python\Anaconda\lib\site-packages\IPython\core\ultratb.py", line 511, in structured_traceback lines = ''.join(self._format_exception_only(etype, value))
File "G:\IDE\python\Anaconda\lib\site-packages\IPython\core\ultratb.py", line 623, in _format_exception_only Colors.Normal, s))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb2 in position 20: ordinal not in range(128)
This error appears right after I import _suffix_tree.pyd, even before any other operations.
However, if I run the file in command line (cmd), it works successfully without any error.
PS: I use Windows, and my user name are ASCII characters.