[issue46855] printing a string with strange characters loops forever

2022-02-26 Thread Éric Araujo

Éric Araujo  added the comment:

Note that the original issue seems to be that you had bytes but pasted it as a 
unicode string.  This works:

>>> b = b'Betrag gr\xc3\xb6\xc3\x9fer als Betrag der Original-Transaktion'
>>> s = b.decode('utf-8')
>>> print(s)
Betrag größer als Betrag der Original-Transaktion

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46855] printing a string with strange characters loops forever

2022-02-25 Thread svilen dobrev


svilen dobrev  added the comment:

aha. ctrl-s also closes it.
seems kind-of ( ctrl-q - ctrl-s )
 https://en.wikipedia.org/wiki/Software_flow_control

thanks, closing this.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46855] printing a string with strange characters loops forever

2022-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

The ordinal range 0x80-0x9F is the C1 control code set [1]. Ordinal 0x9F is 
"Application Program Command" (APC). The command must be terminated by ordinal 
0x9C, "String Terminator" (ST). For example, "\x9f Some Command \x9c". 

In Gnome Terminal, after executing print('\x9f'), an APC command without a 
terminator, typing Ctrl+L still works to clear the screen and get back to a 
prompt.

[1] https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_controls

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46855] printing a string with strange characters loops forever

2022-02-25 Thread svilen dobrev

New submission from svilen dobrev :

$ python
Python 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> a= "Betrag gr\xc3\xb6\xc3\x9fer als Betrag der Original-Transaktion"
>>> a
'Betrag gröÃ\x9fer als Betrag der Original-Transaktion'
>>> print(a)
Betrag gröÃ~ 

---

And above waits forever. Does not consume resources, but does not hear Ctrl-C. 
Ctrl-\ kills it.

The string above is just a byte string of the utf-8 representation, with 
forgotten "b" infront of it.

--
components: Interpreter Core
messages: 414010
nosy: svild
priority: normal
severity: normal
status: open
title: printing a string with strange characters loops forever
type: behavior
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com