classification
Title: binhex REASONABLY_LARGE = 32768 so what is 128000
Type: enhancement Stage: needs patch
Components: Documentation, Library (Lib) Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Jim.Jewett, docs@python, xtreak
Priority: low Keywords:

Created on 2018-07-06 21:42 by Jim.Jewett, last changed 2018-07-13 18:12 by xtreak.

Messages (2)
msg321193 - (view) Author: Jim Jewett (Jim.Jewett) (Python triager) Date: 2018-07-06 21:42
binhex defines a module-wide constant of 

REASONABLY_LARGE = 32768  # Minimal amount we pass the rle-coder

Later on, in 5 locations it does either ifp.read(128000) or ifp.read_rsrc(128000)

It isn't clear why a different constant is used, let alone why a literal is used instead of something like REASONABLY_LARGE.
msg321626 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python triager) Date: 2018-07-13 18:12
I tried changing it to REASONABLY_LARGE and could see no test failures. It seems the literal was added as part of a220e67a9ed94d66b81e393a3bb9e6acd10068c1 (23/03/1996) and REASONABLY_LARGE was before that as added part of fcdffeaaa144147f43224a641b668df539ffb6fe (07/08/1995)

➜  cpython git:(master) time ./python -Werror -m unittest -v test.test_binhex
test_binhex (test.test_binhex.BinHexTestCase) ... ok
test_binhex_error_on_long_filename (test.test_binhex.BinHexTestCase) ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.002s

OK
./python -Werror -m unittest -v test.test_binhex  0.23s user 0.03s system 93% cpu 0.279 total
History
Date User Action Args
2018-07-13 18:12:41xtreaksetnosy: + xtreak
messages: + msg321626
2018-07-06 21:42:25Jim.Jewettcreate