[New-bugs-announce] [issue39353] Deprecate the binhex module

STINNER Victor report at bugs.python.org
Thu Jan 16 04:14:45 EST 2020

New submission from STINNER Victor <vstinner at python.org>:

The binhex module encodes and decodes Apple Macintosh binhex4 data. It was originally developed for TRS-80. In the 1980s and early 1990s it was used on classic Mac OS 9 to encode binary email attachments.

Mac OS 9 is now heavily outdated, replaced by "macOS" (previously known as "Mac OS X").

I propose to emit a DeprecationWarning in the binhex module and document that it's deprecated.

I don't think that we have to schedule its removal yet, it can be decided later. A first deprecation warning emitted at runtime might help to warn last users, if there is any.

There are two binhex open issues:

* bpo-29566: no activity for almost 2 years (February 2017)
* bpo-34063: no activity for 1 year 1/2 (July 2018)

If we ignore global cleanup (done on the whole Python code base at once, not specific to binhex), the binhex was basically untouched since it has been ported to Python 3 (10 years ago). Maybe it means that it is very stable, which can be seen as a quality ;-)

I looked for "import binhex" in the first 10 pages of GitHub code search (restricted to Python programming language). I mostly found copies of Python test_binhex.py, no real usage of binhex.

On Stackoverflow, the latest questions about binhex has been asked in 2012:

I also found an answer suggesting to use binascii.a2b_hex() to decode a string the hexadecimal string "2020202020202020202020205635514d385a5856":

But binascii.unhexlify() does the same than binascii.a2b_hex().

Attached PR deprecates binhex.

components: Library (Lib)
messages: 360100
nosy: serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Deprecate the binhex module
versions: Python 3.9

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list