diff --git a/files.html b/files.html index d794229..bc1b705 100644 --- a/files.html +++ b/files.html @@ -316,7 +316,7 @@ AttributeError: '_io.BufferedReader' object has no attribute 'encoding'Opening a file in binary mode is simple but subtle. The only difference from opening it in text mode is that the mode parameter contains a 'b'.
  • The file object you get from opening a file in binary mode has many of the same attributes, including mode, which reflects the mode parameter you passed into the open() function.
  • File objects for binary files also have a name attribute, just like file objects for text files. -
  • Here’s one difference, though: the file object for a binary file has no encoding attribute. That makes sense, right? You&#re reading (or writing) bytes, not strings, so there’s no conversion for Python to do. What you get out of a binary file is exactly what you put into it, no conversion necessary. +
  • Here’s one difference, though: the file object for a binary file has no encoding attribute. That makes sense, right? You’re reading (or writing) bytes, not strings, so there’s no conversion for Python to do. What you get out of a binary file is exactly what you put into it, no conversion necessary.

    Did I mention you’re reading bytes? Oh yes you are.