1.1 --- a/lib/__builtins__/file.py Tue Dec 13 23:28:09 2016 +0100
1.2 +++ b/lib/__builtins__/file.py Tue Dec 13 23:29:54 2016 +0100
1.3 @@ -76,9 +76,10 @@
1.4
1.5 check_string(s)
1.6
1.7 - # Encode text as bytes if necessary.
1.8 + # Encode text as bytes if necessary. When the encoding is not set, any
1.9 + # original encoding of the text will be applied.
1.10
1.11 - if self.encoding and _isinstance(s, utf8string):
1.12 + if _isinstance(s, utf8string):
1.13 s = s.encode(self.encoding)
1.14
1.15 fwrite(self.__data__, s)