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 — bpo-43956: Doc/c-api: Fix default program name by joukewitteveen · Pull Request #24876 · python/cpython

Conversation

@joukewitteveen

@joukewitteveen joukewitteveen commented Mar 15, 2021 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

This is a minor documentation fix.

The default program name is set in Python/pathconfig.c. It is python on Windows, and python3 elsewhere.

https://bugs.python.org/issue43956

Sorry, something went wrong.

Uh oh!

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

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA not signed label Mar 15, 2021
@the-knights-who-say-ni

the-knights-who-say-ni commented Mar 15, 2021

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@joukewitteveen

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Mar 15, 2021
@the-knights-who-say-ni the-knights-who-say-ni added CLA signed and removed CLA not signed labels Mar 18, 2021
@joukewitteveen

joukewitteveen commented Apr 2, 2021

Copy link
Copy Markdown
Contributor Author

Additionally, the documentation currently says:

The argument should point to a zero-terminated wide character string in static storage whose contents will not change for the duration of the program’s execution.

The code, however, duplicates the string, so I am not sure this is true. Because the duplication might be an implementation detail that is intentionally left open to change, I did not remove this sentence.

All reactions

Sorry, something went wrong.

Uh oh!

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

@joukewitteveen joukewitteveen changed the title Doc/c-api: Fix default program name bpo-43956: Doc/c-api: Fix default program name Apr 27, 2021
@ammaraskar

ammaraskar commented Apr 28, 2021

Copy link
Copy Markdown
Member

The code, however, duplicates the string, so I am not sure this is true. Because the duplication might be an implementation detail that is intentionally left open to change, I did not remove this sentence.

@vstinner do you have an opinion on this? Looks like this part of your commit made it so that Py_SetProgramName duplicates the string:

  • af5a895#diff-09327e0a986b458413322c8ef2c9f7ff06f191cc79520787f95db7598e633415R202
All reactions

Sorry, something went wrong.

Uh oh!

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

@ammaraskar ammaraskar added the skip news label Apr 28, 2021
vstinner
vstinner reviewed Apr 28, 2021
View reviewed changes
Comment thread Doc/c-api/init.rst Outdated

@vstinner vstinner Apr 28, 2021

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to link to https://docs.python.org/dev/c-api/init_config.html#c.PyConfig.program_name which documents the default value.

Sorry, something went wrong.

Uh oh!

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

All reactions

@joukewitteveen joukewitteveen May 1, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I extended the text with a bit more detail. This includes removing the 'static lifetime' remark. Please let me know if that should be reinstated.

Sorry, something went wrong.

Uh oh!

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

All reactions
@joukewitteveen
joukewitteveen force-pushed the patch-1 branch from d4c6f62 to 704faf8 Compare May 1, 2021 10:20
@joukewitteveen
joukewitteveen requested a review from vstinner May 7, 2021 09:26
@vstinner

vstinner commented May 12, 2021

Copy link
Copy Markdown
Member

@joukewitteveen joukewitteveen requested a review from vstinner 5 days ago

I already reviewed the PR. IMO it's a bad idea to document the default program in Py_SetProgramName(). It should link to https://docs.python.org/dev/c-api/init_config.html#c.PyConfig.program_name which is the reference.

Py_SetProgramName() is a legacy API and should be avoided.

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented May 12, 2021 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

I created bpo-44113: "[C API] Deprecate legacy API for configure Python initialization".

All reactions

Sorry, something went wrong.

Uh oh!

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

@joukewitteveen
joukewitteveen force-pushed the patch-1 branch from 704faf8 to d311990 Compare May 12, 2021 15:00
@joukewitteveen

joukewitteveen commented May 12, 2021

Copy link
Copy Markdown
Contributor Author

@joukewitteveen joukewitteveen requested a review from vstinner 5 days ago

I already reviewed the PR.

But I had updated it since, in response to your comments.

I created bpo-44113: "[C API] Deprecate legacy API for configure Python initialization".

I updated the PR to only document the specifics of Py_SetProgramName(). Even though it may be legacy, there is no reason to have incorrect documentation.

All reactions

Sorry, something went wrong.

Uh oh!

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

@joukewitteveen
The default program name is "python3" except on Windows
fdaffbe
The full program name inference is done in Python/initconfig.c and the
reference documentation is with PyConfig.program_name.
@joukewitteveen
joukewitteveen force-pushed the patch-1 branch from d311990 to fdaffbe Compare May 12, 2021 22:41
@vstinner vstinner mentioned this pull request Apr 10, 2022
[C API] Deprecate legacy API for configure Python initialization #88279
Closed
@ezio-melotti ezio-melotti removed the CLA signed label Jul 13, 2022
@erlend-aasland

erlend-aasland commented Jan 11, 2024

Copy link
Copy Markdown
Contributor

Py_SetProgramName and its docs were removed by #105154; closing this PR as out of date.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland erlend-aasland closed this Jan 11, 2024
@joukewitteveen joukewitteveen mannequin mentioned this pull request Jan 12, 2024
C-API: Incorrect default value for Py_SetProgramName #88122
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner Awaiting requested review from vstinner

Uh oh!

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

Assignees

No one assigned

Labels

awaiting review docs Documentation in the Doc dir skip news

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.

7 participants

@joukewitteveen @the-knights-who-say-ni @ammaraskar @vstinner @erlend-aasland @ezio-melotti @bedevere-bot
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.