Snippets tagged “binary-mode”
1 snippet uses this tag.
- TypeError: a bytes-like object is required, not 'str' when writing to a file in Python 3Python
This error occurs when you are trying to write a string to a file using the write() method in Python 3, but the file is opened in binary mode (using the 'b' flag when opening the file).