bpo-43956: Doc/c-api: Fix default program name by joukewitteveen · Pull Request #24876 · python/cpython

@joukewitteveen

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

@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 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!

@joukewitteveen

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.

@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

vstinner

Choose a reason for hiding this comment

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

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

@vstinner

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

@joukewitteveen

@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.

@joukewitteveen

The full program name inference is done in Python/initconfig.c and the
reference documentation is with PyConfig.program_name.

@erlend-aasland

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