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 john_miller
Recipients ezio.melotti, john_miller, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2020-09-20.10:10:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600596635.97.0.661976850635.issue41821@roundup.psfhosted.org>
In-reply-to
Content
I noticed some beeping when printing data to the console (cmd), so I narrowed down the problem to three specific Unicode-characters somehow producing beeps when printed to the Windows console (CMD). This also works in interactive mode. (I checked every single Unicode-character up to sys.maxunicode (except character-values between 0xD800 and 0xE000) by bisecting ever-more fine-grained until I narrowed it down to only those three characters producing unwanted beeps.)

Isolated example of bug: for i in ['\u2022', '\u2024', '\u2219']: print(i)

\u0007 beeps too, but this works as intended.

Python version: 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)]
Windows version: Microsoft Windows 7 Professional (6.1.7601 Service Pack 1 Build 7601)
CMD active code page: 850 (According to chcp-command.) 
sys.stdout.encoding: utf-8

Might be loosly related to PEP-528 (https://www.python.org/dev/peps/pep-0528/)

Addendum:
Piping the output like: 'python.exe script.py >> testfile.txt' produced an error.
This might happen with more Unicode characters but I haven't checked.

Addendum-Example:
Traceback (most recent call last):
  File "pytest2.py", line 38, in <module>
    print(hex(i), ":", chr(i), end='\n')
  File "C:\Python38-32\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2023' in position 0: character maps to <undefined>
History
Date User Action Args
2020-09-20 10:10:36john_millersetrecipients: + john_miller, paul.moore, vstinner, tim.golden, ezio.melotti, zach.ware, steve.dower
2020-09-20 10:10:35john_millersetmessageid: <1600596635.97.0.661976850635.issue41821@roundup.psfhosted.org>
2020-09-20 10:10:35john_millerlinkissue41821 messages
2020-09-20 10:10:35john_millercreate