FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Increase range of bytes_per_sep · Issue #147944 · python/cpython · GitHub

Repository navigation

Increase range of bytes_per_sep #147944

Closed
Closed

Description

Feature or enhancement

The hex() method of bytes, bytearray and memoryview, and the binascii.b2a_hex() function accept bytes_per_sep argument in the range of C int. This is unusual, because maximal size for in-memory structures in Python is limited by sys.maxsize. Actually, passing bytes_per_sep larger than sys.maxsize or less than -sys.maxsize does not make sense, because it will be larger than the length of the converted byte sequence. But this is not so for C int. You get an OverflowError trying to insert a separator every 10GiB in 100GiB data. Yes, the example is not realistic, but this is a matter of principal possibility.

Linked PRs

Activity

  1. added a commit that references this issue on Mar 31, 2026
  2. added a commit that references this issue on Apr 1, 2026
  3. added a commit that references this issue on Apr 16, 2026
  4. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

3.15bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL