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 — `io.IOBase` docs often talk about byte offsets, but the same classes are used for string `io` types which use character offsets · Issue #122299 · python/cpython

io.IOBase docs often talk about byte offsets, but the same classes are used for string io types which use character offsets #122299

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
io.IOBase docs often talk about byte offsets, but the same classes are used for string io types which use character offsets#122299
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir

Description

@andmis
andmis
opened on Jul 26, 2024
Issue body actions

The io.IOBase docs often talk about byte offsets, but the same classes often act as base classes for the string io types, which use character offsets.

PR fixing one such issue: https://github.com/python/cpython/pull/121421/files

Linked PRs

  • gh-122299: fix io.IOBase.seek docs WRT offset type #121421

Activity

  1. andmis
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Jul 26, 2024
  2. vadmium commented on Jul 26, 2024

    @vadmium
    vadmium
    on Jul 26, 2024
    Member
    More actions

    I wouldn’t call it a character offset; the number is not necessarily equal or even proportional to a number of characters. Consider multi-byte encodings, the newline encoder and decoder, and _pyio.StringIO with non-ASCII.

    For character IO seeking, the offset is generally meant to be an opaque value returned by tell, or zero.

    Reacted by Andrey Mishchenko and Erlend E. Aasland
  3. picnixz commented on Dec 2, 2024

    @picnixz
    picnixz
    on Dec 2, 2024
    Member
    More actions

    Considering that multiple core devs expressed their reservation, I will close this one as not planned. If you want to discuss it more in details and/or may suggest a better wording that would be accurate as well, feel free to @ me.

  4. picnixz
    closed this as not plannedon Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc dir

    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.