New submission from Xinmeng Xia <xi...@smail.nju.edu.cn>:

"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')

----------
components: Unicode
messages: 384564
nosy: ezio.melotti, vstinner, xxm
priority: normal
severity: normal
status: open
title: pprint fails in transformming non-breaking space
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42852>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to