Skip to content

Commit a806608

Browse files
authored
bpo-45085: Remove the binhex module (GH-28117)
The binhex module, deprecated in Python 3.9, is now removed. The following binascii functions, deprecated in Python 3.9, are now also removed: * a2b_hqx(), b2a_hqx(); * rlecode_hqx(), rledecode_hqx(). The binascii.crc_hqx() function remains available.
1 parent d589a7e commit a806608

File tree

12 files changed

+30
-1297
lines changed

12 files changed

+30
-1297
lines changed

Doc/library/binascii.rst

+2-45
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
.. index::
99
module: uu
1010
module: base64
11-
module: binhex
1211

1312
--------------
1413

1514
The :mod:`binascii` module contains a number of methods to convert between
1615
binary and various ASCII-encoded binary representations. Normally, you will not
17-
use these functions directly but use wrapper modules like :mod:`uu`,
18-
:mod:`base64`, or :mod:`binhex` instead. The :mod:`binascii` module contains
16+
use these functions directly but use wrapper modules like :mod:`uu` or
17+
:mod:`base64` instead. The :mod:`binascii` module contains
1918
low-level functions written in C for greater speed that are used by the
2019
higher-level modules.
2120

@@ -98,45 +97,6 @@ The :mod:`binascii` module defines the following functions:
9897
stream.
9998

10099

101-
.. function:: a2b_hqx(string)
102-
103-
Convert binhex4 formatted ASCII data to binary, without doing RLE-decompression.
104-
The string should contain a complete number of binary bytes, or (in case of the
105-
last portion of the binhex4 data) have the remaining bits zero.
106-
107-
.. deprecated:: 3.9
108-
109-
110-
.. function:: rledecode_hqx(data)
111-
112-
Perform RLE-decompression on the data, as per the binhex4 standard. The
113-
algorithm uses ``0x90`` after a byte as a repeat indicator, followed by a count.
114-
A count of ``0`` specifies a byte value of ``0x90``. The routine returns the
115-
decompressed data, unless data input data ends in an orphaned repeat indicator,
116-
in which case the :exc:`Incomplete` exception is raised.
117-
118-
.. versionchanged:: 3.2
119-
Accept only bytestring or bytearray objects as input.
120-
121-
.. deprecated:: 3.9
122-
123-
124-
.. function:: rlecode_hqx(data)
125-
126-
Perform binhex4 style RLE-compression on *data* and return the result.
127-
128-
.. deprecated:: 3.9
129-
130-
131-
.. function:: b2a_hqx(data)
132-
133-
Perform hexbin4 binary-to-ASCII translation and return the resulting string. The
134-
argument should already be RLE-coded, and have a length divisible by 3 (except
135-
possibly the last fragment).
136-
137-
.. deprecated:: 3.9
138-
139-
140100
.. function:: crc_hqx(data, value)
141101

142102
Compute a 16-bit CRC value of *data*, starting with *value* as the
@@ -222,9 +182,6 @@ The :mod:`binascii` module defines the following functions:
222182
Support for RFC compliant base64-style encoding in base 16, 32, 64,
223183
and 85.
224184

225-
Module :mod:`binhex`
226-
Support for the binhex format used on the Macintosh.
227-
228185
Module :mod:`uu`
229186
Support for UU encoding used on Unix.
230187

Doc/library/binhex.rst

-59
This file was deleted.

Doc/library/netdata.rst

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ on the internet.
1717
mailbox.rst
1818
mimetypes.rst
1919
base64.rst
20-
binhex.rst
2120
binascii.rst
2221
quopri.rst
2322
uu.rst

Doc/whatsnew/3.11.rst

+12
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,21 @@ sqlite3
235235

236236
Removed
237237
=======
238+
238239
* :class:`smtpd.MailmanProxy` is now removed as it is unusable without
239240
an external module, ``mailman``. (Contributed by Dong-hee Na in :issue:`35800`.)
240241

242+
* The ``binhex`` module, deprecated in Python 3.9, is now removed.
243+
The following :mod:`binascii` functions, deprecated in Python 3.9, are now
244+
also removed:
245+
246+
* ``a2b_hqx()``, ``b2a_hqx()``;
247+
* ``rlecode_hqx()``, ``rledecode_hqx()``.
248+
249+
The :func:`binascii.crc_hqx` function remains available.
250+
251+
(Contributed by Victor Stinner in :issue:`45085`.)
252+
241253

242254
Optimizations
243255
=============

0 commit comments

Comments
 (0)