MFRC522-UART icon indicating copy to clipboard operation
MFRC522-UART copied to clipboard

"unicode strings are not supported" error on windows 10 python 3.7.4

Open bluexp1 opened this issue 4 years ago • 0 comments

I receive this error running the script in terminal: Traceback (most recent call last): File "H:\MFRC522-UART-master\Read.py", line 23, in <module> MIFAREReader = MFRC522.MFRC522() File "H:\MFRC522-UART-master\MFRC522.py", line 107, in __init__ self.reset(spd=1); File "H:\MFRC522-UART-master\MFRC522.py", line 119, in reset if not self.writeRegister(self.CommandReg, self.PCD_RESETPHASE): File "H:\MFRC522-UART-master\MFRC522.py", line 134, in writeRegister self.ser.write(chr(addr&0x7F)) File "E:\Program Files\Python37\lib\site-packages\serial\serialwin32.py", line 308, in write data = to_bytes(data) File "E:\Program Files\Python37\lib\site-packages\serial\serialutil.py", line 63, in to_bytes raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq)) TypeError: unicode strings are not supported, please encode to bytes: '\x01' I think there is a compatibility problem on python 3!

bluexp1 avatar Nov 06 '20 07:11 bluexp1