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 — gh-85283: _stat extension now uses the limited C API by vstinner · Pull Request #110711 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Oct 11, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

The _stat C extension is now built with the limited C API.

  • Issue: [C API] Convert a few stdlib extensions to the limited C API (PEP 384) #85283

📚 Documentation preview 📚: https://cpython-previews--110711.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added the awaiting review label Oct 11, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Oct 11, 2023
[C API] Convert a few stdlib extensions to the limited C API (PEP 384) #85283
Closed
@vstinner

vstinner commented Oct 11, 2023

Copy link
Copy Markdown
Member Author
  • Discussion: https://discuss.python.org/t/use-the-limited-c-api-for-some-of-our-stdlib-c-extensions/32465
  • Previous attempt at the end of August: PR gh-85283: _stat extension uses the limited C API #108573
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Oct 11, 2023

Copy link
Copy Markdown
Member Author

cc @erlend-aasland @corona10 @encukou

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gpshead
gpshead approved these changes Oct 11, 2023
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Oct 11, 2023
@gpshead

gpshead commented Oct 11, 2023

Copy link
Copy Markdown
Member

I approved as this seems trivial so "lets do it!", obviously figuring out the windows build excitement in CI needs to happen first.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Oct 11, 2023

Copy link
Copy Markdown
Member Author

What's going on? Now Windows build fails with:

LINK : fatal error LNK1104: cannot open file 'python313_d.lib' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Oct 11, 2023

Copy link
Copy Markdown
Member Author

LINK : fatal error LNK1104: cannot open file 'python313_d.lib' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Ok, I found the root issue and wrote a fix: PR gh-110725. The problem comes from PyAPI_FUNC(), PyAPI_DATA() and PyMODINIT_FUNC macros which have a different implementation depending if the 3 Py_BUILD_CORE macros are defined or not.

gpshead reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@merwok merwok changed the title gh-85283: _stat extension uses the limited C API gh-85283: _stat extension now uses the limited C API Oct 11, 2023
@vstinner
pythongh-85283: _stat extension uses the limited C API
a0cc4f5
The _stat C extension is now built with the limited C API.
@vstinner
vstinner force-pushed the limited_stat branch from 052d021 to a0cc4f5 Compare October 11, 2023 21:12
erlend-aasland
erlend-aasland approved these changes Oct 11, 2023
View reviewed changes
@vstinner
vstinner merged commit 88ecb19 into python:main Oct 11, 2023
@vstinner
vstinner deleted the limited_stat branch October 11, 2023 22:06
@bedevere-app bedevere-app Bot removed the awaiting core review label Oct 11, 2023
@vstinner

vstinner commented Oct 12, 2023

Copy link
Copy Markdown
Member Author

Merged, thanks for the review @gpshead and @erlend-aasland.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@vstinner @Glyphack
pythongh-85283: _stat extension now uses the limited C API (python#11…
022ef91
…0711)

pythongh-85283: _stat extension uses the limited C API

The _stat C extension is now built with the limited C API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gpshead gpshead gpshead approved these changes
@erlend-aasland erlend-aasland erlend-aasland approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@vstinner @gpshead @erlend-aasland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.