UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to <undefined>

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Jun 13 07:17:31 EDT 2018


On Wed, 13 Jun 2018 04:01:24 -0700, bellcanadardp wrote:

> for line in self.collFile.decode("utf-8"):
> i actually write.encode...then i tried the decode but both dont have any
> effect

Raising AttributeError isn't an effect?

py> f = open("/tmp/x")
py> f.write.decode
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'builtin_function_or_method' object has no attribute 
'decode'



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson




More information about the Python-list mailing list