Skip to content

gh-114673: Docs: Fix os.startfile argument filepath #112359

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jakob-Stadler
Copy link

@Jakob-Stadler Jakob-Stadler commented Nov 24, 2023

Since this is a simple documentation fix, I directly filed it as PR instead of creating an issue first.

During my investigation on issues with os.startfile's annotations in typeshed, I discovered that the first argument name differs between documentation and implementation. ( See python/typeshed#10991 )

While the official docs list the argument name as path (docs), the CPython source code has the first argument as filepath (CPython/main), and firing up a REPL to check actual behavior mirrors the same:

>>> from os import startfile
>>> startfile(path='explorer')
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    startfile(path='explorer')
TypeError: startfile() missing required argument 'filepath' (pos 1)

This PR aims to align the docs with the implementation by renaming the path argument to filepath.


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

@ghost
Copy link

ghost commented Nov 24, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app bedevere-app bot added awaiting review docs Documentation in the Doc dir skip news labels Nov 24, 2023
@serhiy-storchaka serhiy-storchaka changed the title Docs: Fix os.startfile argument filepath gh-114673: Docs: Fix os.startfile argument filepath Jan 28, 2024
@serhiy-storchaka
Copy link
Member

There is more to this. I opened #114673.

@python-cla-bot
Copy link

python-cla-bot bot commented Apr 18, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants