mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
from binhex module. Thanks Vincent Legoll.
This commit is contained in:
parent
a1a54bcef8
commit
45f799fe6e
2 changed files with 2 additions and 13 deletions
|
@ -143,9 +143,6 @@ class BinHex:
|
||||||
if isinstance(ofp, str):
|
if isinstance(ofp, str):
|
||||||
ofname = ofp
|
ofname = ofp
|
||||||
ofp = io.open(ofname, 'wb')
|
ofp = io.open(ofname, 'wb')
|
||||||
if os.name == 'mac':
|
|
||||||
fss = FSSpec(ofname)
|
|
||||||
fss.SetCreatorType('BnHq', 'TEXT')
|
|
||||||
ofp.write(b'(This file must be converted with BinHex 4.0)\r\r:')
|
ofp.write(b'(This file must be converted with BinHex 4.0)\r\r:')
|
||||||
hqxer = _Hqxcoderengine(ofp)
|
hqxer = _Hqxcoderengine(ofp)
|
||||||
self.ofp = _Rlecoderengine(hqxer)
|
self.ofp = _Rlecoderengine(hqxer)
|
||||||
|
@ -446,9 +443,6 @@ def hexbin(inp, out):
|
||||||
finfo = ifp.FInfo
|
finfo = ifp.FInfo
|
||||||
if not out:
|
if not out:
|
||||||
out = ifp.FName
|
out = ifp.FName
|
||||||
if os.name == 'mac':
|
|
||||||
ofss = FSSpec(out)
|
|
||||||
out = ofss.as_pathname()
|
|
||||||
|
|
||||||
ofp = io.open(out, 'wb')
|
ofp = io.open(out, 'wb')
|
||||||
# XXXX Do translation on non-mac systems
|
# XXXX Do translation on non-mac systems
|
||||||
|
@ -469,11 +463,4 @@ def hexbin(inp, out):
|
||||||
ofp.write(d)
|
ofp.write(d)
|
||||||
ofp.close()
|
ofp.close()
|
||||||
|
|
||||||
if os.name == 'mac':
|
|
||||||
nfinfo = ofss.GetFInfo()
|
|
||||||
nfinfo.Creator = finfo.Creator
|
|
||||||
nfinfo.Type = finfo.Type
|
|
||||||
nfinfo.Flags = finfo.Flags
|
|
||||||
ofss.SetFInfo(nfinfo)
|
|
||||||
|
|
||||||
ifp.close()
|
ifp.close()
|
||||||
|
|
|
@ -63,6 +63,8 @@ C-API
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #2715: Remove remnants of Carbon.File from binhex module.
|
||||||
|
|
||||||
- Issue #6595: The Decimal constructor now allows arbitrary Unicode
|
- Issue #6595: The Decimal constructor now allows arbitrary Unicode
|
||||||
decimal digits in input, as recommended by the standard. Previously
|
decimal digits in input, as recommended by the standard. Previously
|
||||||
it was restricted to accepting [0-9].
|
it was restricted to accepting [0-9].
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue