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 xxm
Recipients ezio.melotti, vstinner, xxm
Date 2021-01-07.06:47:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1610002054.28.0.212080312966.issue42852@roundup.psfhosted.org>
In-reply-to
Content
"pprint" can transform unicode like "print". However, pprint fails to transform non-breaking space('\240') . See the following example:

Python 3.10.0a2 (default, Nov 24 2020, 14:18:46) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

Example 1(Results as expected):
---------------------------------------------------------------------
>>> import pprint
>>> print(u'\041 hello')
! hello
>>> pprint.pprint(u'\041 hello')
'! hello'

Example 2(Results not as expected):
---------------------------------------------------------------------
>>> print(u'\240 hello')
  hello
>>> pprint.pprint(u'\240 hello')
'\xa0 hello'

Expected output: the output of pprint.pprint(u'\240 hello') should be consistent with output of print(u'\240 hello')
History
Date User Action Args
2021-01-07 06:47:34xxmsetrecipients: + xxm, vstinner, ezio.melotti
2021-01-07 06:47:34xxmsetmessageid: <1610002054.28.0.212080312966.issue42852@roundup.psfhosted.org>
2021-01-07 06:47:34xxmlinkissue42852 messages
2021-01-07 06:47:34xxmcreate