UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position

Ошибка

UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position

Скорее всего возникает при работе с файлами в которым присутствуют символы другого алфавита. Например кириллические

Возможно проблему с кодировкой удасться решить объявление нужной во время открытия файла

Замените

with open('ваш_файл','r') as f:

На

with open('ваш_файл','r', encoding="utf8") as f:

↓ Python articles ↓
Development in Python
Interactive mode
Virtual environment
str: strings
\: line break
Lists
Loops
Methods
Functions
*args **kwargs
enum
Determine a Python variable type
Testing with Python
Working with REST API in Python
Files: write, read, append, context manager…
Download a file over the network
SQLite3: working with a database
datetime: Date and Time in Python
Selenium + Python
Difficulties when working with Python
DJANGO
Flask
Script for a ZPL printer
socket :Python Sockets
subprocess: run bash commands from Python
multiprocessing: several processes at once
psutil: system resources
sys.argv: command line arguments
PyCharm: IDE
pydantic: data validation
paramiko: SSH from Python
enumerate
json.dumps

Article author: Andrei Olegovich

Похожие статьи

Search this site

Channel @aofeed Chat @aofeedchat

Contacts and cooperation:
I recommend our hosting beget.com
Write to info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: