You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is indeed not implemented. The current implementation handles file contents as str in both Python 2 and 3, and uses some convertions and wrapping into a helper class to make this work - but only if writing and reading is done using the same mode (text or binary). Your best bet is not to mix modes in your code at the moment, if possible.
To fix this, probably file contents shall always be stored as bytes in Python 3, and the encoding explicitely handled if given in open() in Python 3 (currently it is ignored). @jmcgeheeiv: I could have a go at this somewhere in the next week, if you don't mind.
I'm having trouble opening non-ascii files in binary mode using pyfakefs v2.7.
Usually, UnicodeDecodeErrors are raised when opening a file with an inappropriate encoding:
If you open the same file in binary mode, however, no error is raised:
It is even inappropriate to specify an encoding, because bytes are read as-is, so there's no decoding process:
On the other hand, if you try the same thing with pyfakefs,
Any ideas?
The text was updated successfully, but these errors were encountered: