Steven D'Aprano <steve+pyt...@pearwood.info> added the comment: That's not a bug. That's because the file object does have an encoding attribute, which is set to None.
getattr only returns the default when the attribute doesn't exist, not if it exists but is None. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32163> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com