Skip to content
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

Manual claims that run returns nothing #40155

Merged
merged 2 commits into from
Mar 24, 2021
Merged

Manual claims that run returns nothing #40155

merged 2 commits into from
Mar 24, 2021

Conversation

adomasbaliuka
Copy link
Contributor

@adomasbaliuka adomasbaliuka commented Mar 23, 2021

This manual page claims that run returns nothing. However (in version v1.5.3) it returns a Process object (I'm not sure if it always does).

Note: this commit does not (yet) propose changes that can be merged because I don't know for sure how to correct the error.
Note: the more recent (unreleased) versions of this file seem to have the same error.

To reproduce:

julia> VERSION
v"1.5.3"
julia> typeof(run(`echo`))
Base.Process

This  manual page claims that `run` returns `nothing`. However, in version v1.5.3, it returns a `Process` object (I'm not sure if it always does).

To reproduce:
```julia
julia> VERSION
v"1.5.3"
julia> typeof(run(`echo`))
Base.Process
```
@jmkuhn
Copy link
Contributor

jmkuhn commented Mar 23, 2021

You could clarify the meaning by changing the order of the sentence:

If the external command fails to run successfully, the run method returns nothing, and throws an ErrorException.

Edit: the specific exception that is thrown depends on the reason for the failure.

@adomasbaliuka
Copy link
Contributor Author

@jmkuhn Thanks to your comment, I now possibly understand the intended meaning of the sentence. However, I still disagree with the wording: a function that throws an exception cannot return any object. In particular, it does not return nothing, which is an object of type Nothing. If my understanding of this matter is correct, I believe it would be better to completely remove the statement about returning something in case of error.

Suggested change:
If the external command fails to run successfully, the run method throws an ErrorException.

The original text could be misinterpreted as saying that `run` returns `nothing`, which is an object of type `Nothing`. As far as I can tell, there is no circumstance where the method `run(cmds::Base.AbstractCmd, args...; wait) in Base at process.jl:437` (line as of v1.5.3) actually returns `nothing::Nothing`.

I deleted the remark about returning `nothing` from the manual page in question.
@adomasbaliuka adomasbaliuka changed the title WIP: Manual claims that run returns nothing Manual claims that run returns nothing Mar 23, 2021
@adomasbaliuka
Copy link
Contributor Author

@jmkuhn I updated the pull request. The proposed state of the manual file contains changes that I would agree with.

Note: I have not proposed (and don't know the procedure for proposing) adoption of this change for the same manual file in different versions of Julia.

Reproduction of latest commit message (in case it is overlooked):

The original text could be misinterpreted as saying that run returns nothing, which is an object of type Nothing. As far as I can tell, there is no circumstance where the method run(cmds::Base.AbstractCmd, args...; wait) in Base at process.jl:437 (line as of v1.5.3) actually returns nothing::Nothing.

I deleted the remark about returning nothing from the manual page in question.

@ViralBShah ViralBShah added the domain:docs This change adds or pertains to documentation label Mar 24, 2021
@JeffBezanson JeffBezanson merged commit d93fa40 into JuliaLang:master Mar 24, 2021
@JeffBezanson
Copy link
Sponsor Member

Welcome, thanks for finding this!

ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants