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
mention of list2cmdline() in docs of subprocess.Popen #56036
Comments
The documentation of subprocess.Popen mentions a function named list2cmdline(): ---- I find this rather opaque and useless. list2cmdline() in subprocess is publicly accessible (doesn't begin with underscores) but it isn't documented. The solution can be one of the following:
|
I vote for (2) (I presume 'it' in that sentence is 'subprocess'). list2cmdline shouldn't be a "real" public method, at least not without the issues surrounding being given careful design attention. |
I also prefer (2) since I see no reason for the user to use list2cmdline() directly, let alone from subprocess (had there been rationale for such a public function it should probably be in another module). As for 'it', I guess you can say it means 'subprocess' or 'list2cmdline', doesn't matter which. |
Ah, right. I guess I was advocating that the docs be written from the perspective that list2cmdline doesn't exist as an identifiable entity. From the POV of the updated docs, it is just subprocess's behavior, and list2cmdline is an implementation detail. Which is what you were saying. |
bpo-10838 has a bit of discussion about list2cmdline and being part of the public api (generally agreeing that it should be made private, I think). |
Thanks for the pointer, Ross. So I propose to remove the mention of list2cmdline from the documentation of subprocess, explaining instead what it does to the path (since I think this should be publicly known, otherwise it's just black magic). I will prepare a patch for this and post it for review here before committing. Do you folks think we should also prepend an underscore to list2cmdline, thus settling the doubt about its "public-ness" once and for all? Other private functions in subprocess do have underscores prepended. |
If a _ is added to list2cmdline the old name should be kept and deprecated. |
Attaching a proposed patch for 3.2, focusing only on the documentation for the time being (I realize that deprecation is a loaded issue and should be probably handled in a centralized manner). The patch removes mention of list2cmdline, instead explaining its intention (using the docstring of list2cmdline quite literally). I realize this isn't an ideal approach, but IMHO it's much better than what we have now. Suggestions are most welcome. |
LGTM. |
New changeset e7a55e236b8b by Eli Bendersky in branch '3.1': |
New changeset f38489a3394f by Eli Bendersky in branch '2.7': |
Patch committed to 3.3, 3.2, 3.1, 2.7 In case no objections arise, I will close this issue in a couple of days |
The module docstring (which duplicates the reST docs) still mentions list2cmdline. I’d vote for removal there too. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: