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 — Duplicated st_ino calculation · Issue #101810 · python/cpython

Duplicated st_ino calculation #101810

New issue
Copy link
New issue
Copy link
Closed
Closed
Duplicated st_ino calculation#101810
Copy link
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixesOS-windowstype-featureA feature request or enhancementA feature request or enhancement

Description

@juria90
juria90
opened on Feb 10, 2023
Issue body actions

Feature or enhancement

The status->st_ino = (((uint64_t)info.nFileIndexHigh) << 32) + info.nFileIndexLow; in function _Py_fstat_noraise() in file Python/fileutils.c is already calculated and assigned in the function _Py_attribute_data_to_stat() in same file.
So I'm proposing removing the duplicated code.

Pitch

It's a duplicated code that is already done in the previous function call _Py_attribute_data_to_stat().

Previous discussion

Linked PRs

  • gh-101810: Remove duplicated st_ino calculation #101811

Activity

  1. juria90
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Feb 10, 2023
  2. eryksun
    added
    3.11only security fixesonly security fixes
    3.10 (EOL)end of lifeend of life
    3.12only security fixesonly security fixes
    OS-windows
    on Feb 10, 2023
  3. eryksun commented on Feb 10, 2023

    @eryksun
    eryksun
    on Feb 10, 2023
    Contributor
    More actions

    This redundant calculation has been in the source for a very long time. 😳

    In 3.1, attribute_data_to_stat() in "Modules/posixmodule.c" was based on a WIN32_FILE_ATTRIBUTE_DATA record, and win32_fstat() didn't use attribute_data_to_stat().

    In 3.2, attribute_data_to_stat() was updated to use a BY_HANDLE_FILE_INFORMATION record, and win32_fstat() was updated to call attribute_data_to_stat(). A redundant st_ino calculation was left in place, however.

    In 3.5, win32_fstat() was moved to _Py_fstat_noraise() in "Python/fileutils.c", but apparently no one noticed the redundant calculation.

  4. zooba
    added a commit that references this issue on Feb 13, 2023

    gh-101810: Remove duplicated st_ino calculation (GH-101811)

    95cbb3d
  5. carljm
    added a commit that references this issue on Feb 13, 2023

    Merge branch 'main' into inlinecomp2

    ae0bd02
  6. OTheDev commented on Feb 14, 2023

    @OTheDev
    OTheDev
    on Feb 14, 2023
    Contributor
    More actions

    @juria90 Can this issue be closed?

  7. zooba
    closed this as completedon Feb 14, 2023
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

    3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixesOS-windowstype-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.