diff --git a/pyfakefs/fake_filesystem.py b/pyfakefs/fake_filesystem.py index ec3089d5..b3a2833c 100644 --- a/pyfakefs/fake_filesystem.py +++ b/pyfakefs/fake_filesystem.py @@ -296,7 +296,7 @@ def _SetInitialContents(self, contents): elif isinstance(contents, Hexlified): st_size = len(contents) else: - st_size = len(contents.encode('utf=8')) + st_size = len(contents.encode('utf-8')) if self.contents: self.SetSize(0)