File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -684,9 +684,11 @@ def print_formatted_text(
684
684
else :
685
685
output .reset_attributes ()
686
686
687
+ # Eliminate carriage returns
688
+ text = text .replace ('\r ' , '' )
689
+
687
690
# Assume that the output is raw, and insert a carriage return before
688
691
# every newline. (Also important when the front-end is a telnet client.)
689
- assert '\r ' not in text
690
692
output .write (text .replace ('\n ' , '\r \n ' ))
691
693
692
694
# Reset again.
Original file line number Diff line number Diff line change @@ -49,6 +49,12 @@ def test_print_formatted_text():
49
49
assert b'hello' in f .data
50
50
assert b'world' in f .data
51
51
52
+ @pytest .mark .skipif (
53
+ is_windows (), reason = "Doesn't run on Windows yet." )
54
+ def test_print_formatted_text_backslash_r ():
55
+ f = _Capture ()
56
+ pt_print ('hello\r \n ' , file = f )
57
+ assert b'hello' in f .data
52
58
53
59
@pytest .mark .skipif (
54
60
is_windows (), reason = "Doesn't run on Windows yet." )
You can’t perform that action at this time.
0 commit comments