Fix the second reincarnation of SF #456395 -- failure on IRIX. This

time use .replace() to change all \r\n into \n, not just the last one.
This commit is contained in:
Guido van Rossum 2001-09-11 14:24:35 +00:00
parent 779ce4a73a
commit dc795b82aa
1 changed files with 2 additions and 6 deletions

View File

@ -34,17 +34,13 @@ if not os.isatty(slave_fd):
debug("Writing to slave_fd") debug("Writing to slave_fd")
os.write(slave_fd, TEST_STRING_1) os.write(slave_fd, TEST_STRING_1)
s1 = os.read(master_fd, 1024) s1 = os.read(master_fd, 1024)
if s1[-2:] == "\r\n": sys.stdout.write(s1.replace("\r\n", "\n"))
s1 = s1[:-2] + "\n"
sys.stdout.write(s1)
debug("Writing chunked output") debug("Writing chunked output")
os.write(slave_fd, TEST_STRING_2[:5]) os.write(slave_fd, TEST_STRING_2[:5])
os.write(slave_fd, TEST_STRING_2[5:]) os.write(slave_fd, TEST_STRING_2[5:])
s2 = os.read(master_fd, 1024) s2 = os.read(master_fd, 1024)
if s2[-2:] == "\r\n": sys.stdout.write(s2.replace("\r\n", "\n"))
s2 = s2[:-2] + "\n"
sys.stdout.write(s2)
os.close(slave_fd) os.close(slave_fd)
os.close(master_fd) os.close(master_fd)