Yasuhito FUTATSUKI wrote on Sat, 12 Oct 2019 03:01 +00:00: > If textual comparison is sufficient here, it is right to open file > text mode (with suitable, unified set of `encoding', `errors', and `newline' > parameter). Otherwise, if strict comparison is needed, we must avoid unwanted, > not one-on-one corresponding conversion from bytes to str applied by Python. > In the latter case, it may be rather incorrect to use > compare_and_display_lines().
Good question. I suspect textual comparison would suffice here, because this is a tree conflicts test, not a keywords semantics test, and the test case seems to revolve around the tree changes, not around the newline characters. So, how about: 1. Make the test use non-binary mode for changing and reading the file 'lambda'. 2. Locally revert the C part of r1841731 and make sure the modified test still (correctly) fails. (That revision both added the test and fixed the bug the test checks for.) Alternatively, we could make the test verify the contents of 'lambda' in binary mode without using compare_and_display_lines. Makes sense? Cheers, Daniel