example.yaml contained a typo. Here is the corrected version
To reproduce the bug: def test_example(tmp_path: Path): import ruamel.yaml input_file = Path("example.yaml") yaml = ruamel.yaml.YAML() correctly_parsed = yaml.load(open(input_file, "r")) incorrectly_parsed = yaml.load(input_file) output_path_correct = tmp_path / "correct.yaml" output_path_incorrect = tmp_path / "incorrect.yaml" yaml.dump(correctly_parsed, output_path_correct) yaml.dump(incorrectly_parsed, output_path_incorrect) # This assertion fails, because incorrect.yaml contains additional CR...
Fix #566: RoundTripScanner incorrectly scans comments with CRLF line endings
RoundTripScanner incorrectly scans comments with CRLF line endings
Fix scanning of CRLF in RoundTripScanner: Scan line break with self.scan_line_break() instead of srf()
Fix scanning of CRLF in RoundTripScanner: Add tests