[3.8] bpo-29566: binhex.binhex now consitently writes MacOS 9 line en… · python/cpython@39a56e5

Original file line numberDiff line numberDiff line change

@@ -45,6 +45,18 @@ def test_binhex_error_on_long_filename(self):

4545
4646

self.assertRaises(binhex.Error, binhex.binhex, self.fname3, self.fname2)

4747
48+

def test_binhex_line_endings(self):

49+

# bpo-29566: Ensure the line endings are those for macOS 9

50+

with open(self.fname1, 'wb') as f:

51+

f.write(self.DATA)

52+
53+

binhex.binhex(self.fname1, self.fname2)

54+
55+

with open(self.fname2, 'rb') as fp:

56+

contents = fp.read()

57+
58+

self.assertNotIn(b'\n', contents)

59+
4860

def test_main():

4961

support.run_unittest(BinHexTestCase)

5062