From f20e3b80393a1a5909a050cb7bb9cbce9e044827 2022-06-16 21:01:10 From: Maxim Cournoyer Date: 2022-06-16 21:01:10 Subject: [PATCH] utils: coloransi: Escape Unicode U0001 and U0002 non-printable characters. Fixes #13637. These Unicode characters, would cause problems when processed by LaTeX to generate the info or PDF documentation targets. * IPython/utils/coloransi.py (InputTermColors): Escape the backslashes in \001 and \002 so that they are shown as literals '\001' and '\002' strings in the Sphinx-generated documentation rather than as non-printable Unicode characters. --- diff --git a/IPython/utils/coloransi.py b/IPython/utils/coloransi.py index e331421..9300b01 100644 --- a/IPython/utils/coloransi.py +++ b/IPython/utils/coloransi.py @@ -74,8 +74,8 @@ make_color_table(TermColors) class InputTermColors: """Color escape sequences for input prompts. - This class is similar to TermColors, but the escapes are wrapped in \001 - and \002 so that readline can properly know the length of each line and + This class is similar to TermColors, but the escapes are wrapped in \\001 + and \\002 so that readline can properly know the length of each line and can wrap lines accordingly. Use this class for any colored text which needs to be used in input prompts, such as in calls to raw_input().