* Add test capturing failure.
* Honor newlines as present in the original file.
set.
"""
try:
- fp = io.open(filename, "w", encoding=encoding)
+ fp = io.open(filename, "w", encoding=encoding, newline='')
except OSError as err:
self.log_error("Can't create %s: %s", filename, err)
return
old, new = self.refactor_file(fn)
self.assertIn(b"\r\n", old)
self.assertIn(b"\r\n", new)
+ self.assertNotIn(b"\r\r\n", new)
def test_refactor_docstring(self):
rt = self.rt()
--- /dev/null
+Remove extraneous CR in 2to3 refactor.