Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binhex REASONABLY_LARGE = 32768 so what is 128000 #78244

Closed
jimjjewett mannequin opened this issue Jul 6, 2018 · 3 comments
Closed

binhex REASONABLY_LARGE = 32768 so what is 128000 #78244

jimjjewett mannequin opened this issue Jul 6, 2018 · 3 comments
Labels
3.8 only security fixes docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@jimjjewett
Copy link
Mannequin

jimjjewett mannequin commented Jul 6, 2018

BPO 34063
Nosy @JimJJewett, @tirkarthi

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2018-07-06.21:42:25.365>
labels = ['3.8', 'type-feature', 'library', 'docs']
title = 'binhex REASONABLY_LARGE = 32768 so what is 128000'
updated_at = <Date 2018-07-13.18:12:41.161>
user = 'https://github.com/JimJJewett'

bugs.python.org fields:

activity = <Date 2018-07-13.18:12:41.161>
actor = 'xtreak'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation', 'Library (Lib)']
creation = <Date 2018-07-06.21:42:25.365>
creator = 'Jim.Jewett'
dependencies = []
files = []
hgrepos = []
issue_num = 34063
keywords = []
message_count = 2.0
messages = ['321193', '321626']
nosy_count = 3.0
nosy_names = ['docs@python', 'Jim.Jewett', 'xtreak']
pr_nums = []
priority = 'low'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue34063'
versions = ['Python 3.8']

@jimjjewett
Copy link
Mannequin Author

jimjjewett mannequin commented Jul 6, 2018

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.

@jimjjewett jimjjewett mannequin added the 3.8 only security fixes label Jul 6, 2018
@jimjjewett jimjjewett mannequin assigned docspython Jul 6, 2018
@jimjjewett jimjjewett mannequin added docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jul 6, 2018
@tirkarthi
Copy link
Member

I tried changing it to REASONABLY_LARGE and could see no test failures. It seems the literal was added as part of a220e67 (23/03/1996) and REASONABLY_LARGE was before that as added part of fcdffea (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

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@hugovk
Copy link
Member

hugovk commented Apr 29, 2022

Closing as the binhex module has been removed in Python 3.11, after being deprecated since 3.9:

cc @JimJJewett@tirkarthi

@hugovk hugovk closed this as completed Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.8 only security fixes docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants