contains characters not encodable to the stdout encoding.
def pager(text):
"""The first time this is called, determine what kind of pager to use."""
global pager
+ # Escape non-encodable characters to avoid encoding errors later
+ encoding = sys.getfilesystemencoding()
+ text = text.encode(encoding, 'backslashreplace').decode(encoding)
pager = getpager()
pager(text)
- Issue #21396: Fix TextIOWrapper(..., write_through=True) to not force a
flush() on the underlying binary stream. Patch by akira.
+- Issue #21398: Fix an unicode error in the pydoc pager when the documentation
+ contains characters not encodable to the stdout encoding.
+
Tests
-----