This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author doerwalter
Recipients doerwalter
Date 2020-08-03.18:29:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1596479352.95.0.492861771572.issue41465@roundup.psfhosted.org>
In-reply-to
Content
PEP 293 states the following:

"""
For stream readers/writers the errors attribute must be changeable to be able to switch between different error handling methods during the lifetime of the stream reader/writer. This is currently the case for codecs.StreamReader and codecs.StreamWriter and all their subclasses. All core codecs and probably most of the third party codecs (e.g. JapaneseCodecs) derive their stream readers/writers from these classes so this already works, but the attribute errors should be documented as a requirement.
"""

However for io.TextIOWrapper, the errors attribute can not be changed:

Python 3.8.5 (default, Jul 21 2020, 10:48:26)
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import io
>>> s = io.TextIOWrapper(io.BytesIO())
>>> s.errors = 'replace'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: attribute 'errors' of '_io.TextIOWrapper' objects is not writable

So the errors attribute of io.TextIOWrapper should be made writable.
History
Date User Action Args
2020-08-03 18:29:12doerwaltersetrecipients: + doerwalter
2020-08-03 18:29:12doerwaltersetmessageid: <1596479352.95.0.492861771572.issue41465@roundup.psfhosted.org>
2020-08-03 18:29:12doerwalterlinkissue41465 messages
2020-08-03 18:29:12doerwaltercreate