Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-43956: Doc/c-api: Fix default program name#24876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
joukewitteveen wants to merge1 commit intopython:mainfromjoukewitteveen:patch-1

Conversation

joukewitteveen
Copy link
Contributor

@joukewitteveenjoukewitteveen commentedMar 15, 2021
edited by bedevere-bot
Loading

This is a minor documentation fix.

The default program name is set inPython/pathconfig.c. It ispython on Windows, andpython3 elsewhere.

https://bugs.python.org/issue43956

@the-knights-who-say-ni

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 thePSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find abugs.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 followthe steps outlined in the CPython devguide to rectify this issue.

You cancheck yourself to see if the CLA has been received.

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

@joukewitteveen
Copy link
ContributorAuthor

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.

@joukewitteveenjoukewitteveen changed the titleDoc/c-api: Fix default program namebpo-43956: Doc/c-api: Fix default program nameApr 27, 2021
@ammaraskar
Copy link
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 thatPy_SetProgramName duplicates the string:

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. No code in the Python interpreter will change the contents of
this storage.
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
ContributorAuthor

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.

@vstinner
Copy link
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 tohttps://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.

@vstinner
Copy link
Member

vstinner commentedMay 12, 2021
edited by bedevere-bot
Loading

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

@joukewitteveen
Copy link
ContributorAuthor

@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 createdbpo-44113: "[C API] Deprecate legacy API for configure Python initialization".

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

The full program name inference is done in Python/initconfig.c and thereference documentation is with PyConfig.program_name.
@erlend-aasland
Copy link
Contributor

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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vstinnervstinnerAwaiting requested review from vstinner

Assignees
No one assigned
Labels
awaiting reviewdocsDocumentation in the Doc dirskip news
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

7 participants
@joukewitteveen@the-knights-who-say-ni@ammaraskar@vstinner@erlend-aasland@ezio-melotti@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp