GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Increase range of bytes_per_sep · Issue #147944 · python/cpython

Increase range of bytes_per_sep #147944

New issue
Copy link
New issue
Copy link
Closed
Closed
Increase range of bytes_per_sep#147944
Copy link
Assignees
serhiy-storchaka
Labels
3.15bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement

Description

@serhiy-storchaka
serhiy-storchaka
opened on Mar 31, 2026
Issue body actions

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

  • gh-147944: Increase range of bytes_per_sep #147946

Activity

  1. serhiy-storchaka
    self-assigned this
    on Mar 31, 2026
  2. serhiy-storchaka
    added
    type-featureA feature request or enhancementA feature request or enhancement
    3.15bugs and security fixesbugs and security fixes
    on Mar 31, 2026
  3. serhiy-storchaka
    added a commit that references this issue on Mar 31, 2026

    pythongh-147944: Increase range of bytes_per_sep

    113cf3a
  4. StanFromIreland
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Mar 31, 2026
  5. serhiy-storchaka
    added a commit that references this issue on Apr 1, 2026

    gh-147944: Increase range of bytes_per_sep (GH-147946)

    473d2a3
  6. serhiy-storchaka
    closed this as completedon Apr 1, 2026
  7. clin1234
    added a commit that references this issue on Apr 16, 2026

    pythongh-147944: Increase range of bytes_per_sep (pythonGH-147946)

    d600042
  8. ljfp
    added a commit that references this issue on Apr 25, 2026

    pythongh-147944: Increase range of bytes_per_sep (pythonGH-147946)

    0044f30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @serhiy-storchaka
    serhiy-storchaka

Labels

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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.