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 @@ -679,9 +679,11 @@ def print_formatted_text(
679
679
else :
680
680
output .reset_attributes ()
681
681
682
+ # Eliminate carriage returns
683
+ text = text .replace ('\r ' , '' )
684
+
682
685
# Assume that the output is raw, and insert a carriage return before
683
686
# every newline. (Also important when the front-end is a telnet client.)
684
- assert '\r ' not in text
685
687
output .write (text .replace ('\n ' , '\r \n ' ))
686
688
687
689
# Reset again.
Original file line number Diff line number Diff line change @@ -48,6 +48,12 @@ def test_print_formatted_text():
48
48
assert b'hello' in f .data
49
49
assert b'world' in f .data
50
50
51
+ @pytest .mark .skipif (
52
+ is_windows (), reason = "Doesn't run on Windows yet." )
53
+ def test_print_formatted_text_backslash_r ():
54
+ f = _Capture ()
55
+ pt_print ('hello\r \n ' , file = f )
56
+ assert b'hello' in f .data
51
57
52
58
@pytest .mark .skipif (
53
59
is_windows (), reason = "Doesn't run on Windows yet." )
You can’t perform that action at this time.
0 commit comments