$ python
Python 2.7.15 (default, Dec 27 2018, 16:25:17)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
pip show zhpy
Name: zhpy
Version: 1.7.4
Summary: 周蟒, Write python language in chinese
Home-page: https://github.com/gasolin/zhpy
Author: Fred Lin
Author-email: gasolin+zhpy@gmail.com
License: MIT <http://www.opensource.org/licenses/mit-license.php>
Location: /Users/hugo/.pyenv/versions/2.7.15/envs/env-2.7.15/lib/python2.7/site-packages
Requires: chardet
Required-by:
Error
when i want use the interpreter
$ zhpy
zhpy 1.7.4 in darwin on top of Python 2.7.15
>>> 印出 '哈囉, 世界'
get TypeError: Expected object of type bytes or bytearray, got: <type 'unicode'>
all informations like this
Traceback (most recent call last):
File "/Users/hugo/.pyenv/versions/env-2.7.15/bin/zhpy", line 11, in <module>
sys.exit(commandline())
File "/Users/hugo/.pyenv/versions/2.7.15/envs/env-2.7.15/lib/python2.7/site-packages/zhpy/commandline.py", line 108, in commandline
interpreter()
File "/Users/hugo/.pyenv/versions/2.7.15/envs/env-2.7.15/lib/python2.7/site-packages/zhpy/interpreter.py", line 164, in interpreter
con.interact(banner)
File "/Users/hugo/.pyenv/versions/2.7.15/lib/python2.7/code.py", line 243, in interact
more = self.push(line)
File "/Users/hugo/.pyenv/versions/2.7.15/envs/env-2.7.15/lib/python2.7/site-packages/zhpy/interpreter.py", line 46, in push
more = self.runsource(convertor(source, encoding=encoding),
File "/Users/hugo/.pyenv/versions/2.7.15/envs/env-2.7.15/lib/python2.7/site-packages/zhpy/zhpy.py", line 277, in convertor
det = chardet.detect(text)
File "/Users/hugo/.pyenv/versions/2.7.15/envs/env-2.7.15/lib/python2.7/site-packages/chardet/__init__.py", line 34, in detect
'{0}'.format(type(byte_str)))
TypeError: Expected object of type bytes or bytearray, got: <type 'unicode'>
My env
pip show zhpy
Error
when i want use the interpreter
get
TypeError: Expected object of type bytes or bytearray, got: <type 'unicode'>
all informations like this
How can i fix this error? thx.