bpo-29566: binhex.binhex now consitently writes MacOS 9 line endings. (GH-23059)

[bpo-29566]() notes that binhex.binhex uses inconsistent line endings (both Unix and MacOS9 line endings are used). This PR changes this to use the MacOS9 line endings everywhere.
This commit is contained in:
Ronald Oussoren 2020-11-01 10:08:48 +01:00 committed by GitHub
parent d3b4e06807
commit 2165cea548
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View file

@ -117,12 +117,12 @@ class _Hqxcoderengine:
first = 0
while first <= len(self.hqxdata) - self.linelen:
last = first + self.linelen
self.ofp.write(self.hqxdata[first:last] + b'\n')
self.ofp.write(self.hqxdata[first:last] + b'\r')
self.linelen = LINELEN
first = last
self.hqxdata = self.hqxdata[first:]
if force:
self.ofp.write(self.hqxdata + b':\n')
self.ofp.write(self.hqxdata + b':\r')
def close(self):
if self.data: