mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-01-24 12:47:07 -05:00
Opening a file in binary mode in python3 returns a BufferedReader which does not have an encoding attribute. Assume in this case it is functionally equivalent to None. I'm not sure when pml_stream.encoding will ever equal anything, since even on python2 the attribute exists but is None when opening files in binary mode... which we explicitly do. So I'm not sure why this ever checks the existing encoding. Possibly when the input plugin is given a file opened in text mode, not raw mode? in that case, it may be wrong to always decode it when reading.