The Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0x80 in position 3131: invalid start byte appears in the process of using Python 3 to read files on Mac OS.
The reason is: OS X system has hidden file. DS in the folder_ Store file, affecting the file read.
.DS_ Store is a hidden file that stores the custom properties of a folder on Mac OS, such as its icon location or background color.
The solution is: use the command line to enter the folder where the file is read and delete. DS_ Store file.
1. Use the command LS – A to view. DS_ Store file
2. rm .DS_ Store。
Read More:
- Solution of Unicode decodeerror -‘utf-8 ‘codec can’t decode byte 0xc4 in position 0 – invalid continuation byte
- Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0xd3 in position 238: invalid continuation B
- Successfully resolved Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0xd3 in position 238: invalid continuation B
- When reading the CSV file with Python 3, the Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0xd0 in position 0: invalid con appears
- UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd6 in position 3089: invalid continuation byte
- Solve the ‘UTF-8’ codec can’t decode byte 0xe9 in position 3114: invalid continuation byte error
- UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xc3 in position 54: invalid continuation byte
- ‘ascii‘ codec can‘t decode byte 0x90 in position 614: ordinal not in range(128)
- Run Python file for the first time with eclipse / pydev: “UTF-8 ‘codec can’t decode byte 0xc4 in position
- Python SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3:
- python SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: trunca
- Syntax Error: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position resolution
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- Cause: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 26; Byte 1 of 1-byte UTF-8 sequence is invalid.
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- How to solve the problem of syntax error: (Unicode error)’unicodescape ‘codec can’t decode bytes in position 2-3: truncat
- JSON parse e rror: Invalid UTF-8 middle byte 0x3f;
- ERROR: invalid byte sequence for encoding “UTF8”: 0x00
- Unicode encodeerror: ‘GBK’ codec can’t encode character solution
- Error: line contains null byte