(data)
| 44 | # and normalize_output can be used. |
| 45 | |
| 46 | def normalize_output(data): |
| 47 | # Some operating systems do conversions on newline. We could possibly fix |
| 48 | # that by doing the appropriate termios.tcsetattr()s. I couldn't figure out |
| 49 | # the right combo on Tru64. So, just normalize the output and doc the |
| 50 | # problem O/Ses by allowing certain combinations for some platforms, but |
| 51 | # avoid allowing other differences (like extra whitespace, trailing garbage, |
| 52 | # etc.) |
| 53 | |
| 54 | # This is about the best we can do without getting some feedback |
| 55 | # from someone more knowledgable. |
| 56 | |
| 57 | # OSF/1 (Tru64) apparently turns \n into \r\r\n. |
| 58 | if data.endswith(b'\r\r\n'): |
| 59 | return data.replace(b'\r\r\n', b'\n') |
| 60 | |
| 61 | if data.endswith(b'\r\n'): |
| 62 | return data.replace(b'\r\n', b'\n') |
| 63 | |
| 64 | return data |
| 65 | |
| 66 | def _readline(fd): |
| 67 | """Read one line. May block forever if no newline is read.""" |
no test coverage detected
searching dependent graphs…