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 Jeffrey.Kintscher
Recipients Jeffrey.Kintscher, doerwalter
Date 2020-08-06.00:21:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1596673297.56.0.245641682153.issue41465@roundup.psfhosted.org>
In-reply-to
Content
I looked at the implementation in Lib/_pyio.py.  The only way to change the error handler is by calling TextIOWrapper.reconfigure() and supply the new error handler as the "errors" parameter.  For example:

>>> import io
>>> s = io.TextIOWrapper(io.BytesIO())
>>> print(s.errors)
strict
>>> s.reconfigure(errors='replace')
>>> print(s.errors)
replace
>>>
History
Date User Action Args
2020-08-06 00:21:37Jeffrey.Kintschersetrecipients: + Jeffrey.Kintscher, doerwalter
2020-08-06 00:21:37Jeffrey.Kintschersetmessageid: <1596673297.56.0.245641682153.issue41465@roundup.psfhosted.org>
2020-08-06 00:21:37Jeffrey.Kintscherlinkissue41465 messages
2020-08-06 00:21:37Jeffrey.Kintschercreate