Closed biencuong closed 5 years ago
Hi biencuong, Two questions:
Hi biencuong, Two questions:
- What device do you have (model) ?
- There are valid users stored in the terminal ?
With the pyzk library, I process by command: import sys sys.path.append("zk") reload(sys) sys.setdefaultencoding('utf8')
Could you please explain what is the idea behind
import sys
sys.path.append("zk")
reload(sys)
I didn't understand
Bạn có thể giải thích ý tưởng đằng sau
import sys sys.path.append("zk") reload(sys)
Tôi không hiểu import sys sys.path.append ("zk") reload (sys) sys.setdefaultencoding ('utf8') Since the username has a unicode character, I use that to fix the error "UnicodeDecodeError: 'ascii' codec"
So you fixed the error with that? If so it is working fine or there is still a problem? with the realtime test it should appear some events on the terminal, that can be triggered by placing finger on the reader, for example
So you fixed the error with that? If so it is working fine or there is still a problem? with the realtime test it should appear some events on the terminal, that can be triggered by placing finger on the reader, for example
It does not solve the problem (only works with python2). Now we need to solve the problem of UnicodeDecodeError: 'ascii' in data_user.py, line 49, in read_all_user_id.
Im not sure, but maybe replacing 49 line in data_user.py with
# extract user name
user_name = users_dataset[i+11:i+35].decode('utf-8')
Should work, I did this in a new branch issue2-name_error
I did it, thank you!
Please help me with this error: root@OrangePI:/home/zk/pyzatt/tests# python3 test_realtime.py ##############################################################################
TEST OF REALTIME FUNCTIONS
##############################################################################
1.Realtime Test
Traceback (most recent call last): File "test_realtime.py", line 36, in
z.read_all_user_id()
File "/root/.local/lib/python3.4/site-packages/PyZatt-1.0-py3.4.egg/pyzk/zkmodules/data_user.py", line 49, in read_all_user_id
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
Best regards!