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

Change open(cmd) to return Process instead of Tuple #12807

Merged
merged 2 commits into from
May 8, 2017

Conversation

vtjnash
Copy link
Sponsor Member

@vtjnash vtjnash commented Aug 26, 2015

fixes #9659 by changing open(Cmd) to only return a Process, and defining close(Process) to mean close(Process.in) && close(Process.out). this is a breaking change, since i know of no way to sanely provide a deprecation for this (I would prefer not to define iteration over a Process object as returning the old tuple of (io, process))

@vtjnash vtjnash added the kind:breaking This change will break code label Aug 26, 2015
@StefanKarpinski
Copy link
Sponsor Member

If I'm groking this change correctly, I think it's an improvement. Can you give an example of the new usage as opposed to the old one (which I never cared for)?

@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Aug 26, 2015

just take a look at the PR diff, since most of it is to deal with the impact of the switch on usages in this repo

@StefanKarpinski
Copy link
Sponsor Member

Wouldn't it be fairly straightforward to add deprecated methods to iterate a process object?

@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Aug 26, 2015

somewhat, it's just really strange to define the iteration to first return either .in or .out (depending on a flag set during construction), then return the object itself.

@StefanKarpinski
Copy link
Sponsor Member

Agreed, but it's just for deprecation purposes, it's not like we'd be advocating that API (quite the opposite).

@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Aug 26, 2015

alright, I think those methods should cover the most common usages of the previous definition

@mbaz
Copy link
Contributor

mbaz commented Sep 3, 2015

Is there any chance of having this merged before 0.4 is released? I'm almost ready to release a new Gaston version to go along with 0.4, but this issue is holding it up.

@tkelman
Copy link
Contributor

tkelman commented Sep 4, 2015

Unlikely unless this gets changed to not be breaking.

@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Sep 12, 2015

rebased. should I merge this and see whether it plays out as a good change, or perhaps suggests an even better design in the future?

@StefanKarpinski
Copy link
Sponsor Member

I think it's too late for this to get into 0.4, unfortunately.

@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Sep 14, 2015

The question was for master, not 0.4

@StefanKarpinski
Copy link
Sponsor Member

Oh, right, that's a different story

@@ -770,6 +770,16 @@ end
const FloatingPoint = AbstractFloat
export FloatingPoint

# 12807
Copy link
Contributor

Choose a reason for hiding this comment

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

move to new 0.5 section along with AsyncStream

@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Sep 14, 2015

this is failing due to a (subtle but common) bug in the test of our IO framework. anyone care to take the shot at guessing?

@tkelman
Copy link
Contributor

tkelman commented Feb 28, 2016

Clearly nobody guessed. Does it still apply?

Also, does this implement the

a process object should inherit from stream and redirect reads and writes to the appropriate stdin/stdout stream

portion of the suggested change? I'm not seeing that.

@tkelman
Copy link
Contributor

tkelman commented Sep 14, 2016

does this need doc changes? along with a rebase obviously

@JeffBezanson
Copy link
Sponsor Member

Bump.

@StefanKarpinski
Copy link
Sponsor Member

@vtjnash – I'm pretty overloaded right now. Any chance you could dust this off on move it forward?

@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Apr 24, 2017

dusted.

🙂

@@ -1307,6 +1307,15 @@ end
end
end

# 12807
Copy link
Contributor

Choose a reason for hiding this comment

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

post 0.6

@amitmurthy
Copy link
Contributor

Use variable name pobj instead of io everywhere as it is the process object and not the io handle being returned.

@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Apr 25, 2017

It's both: the process objects are also AbstractPipe objects. Generally I tried to preserve whichever name seemed to better reflect how it was to be used.

@StefanKarpinski StefanKarpinski changed the title Change open(cmd) to return Process instead of Tuple POST 0.6: Change open(cmd) to return Process instead of Tuple Apr 25, 2017
…lue)

This reverts commit 8ffdfc2,
and fixes it a bit too :)

fix #9659
tkelman
tkelman previously requested changes May 2, 2017
Copy link
Contributor

@tkelman tkelman left a comment

Choose a reason for hiding this comment

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

deprecations need to move to 0.7 section

@StefanKarpinski StefanKarpinski changed the title POST 0.6: Change open(cmd) to return Process instead of Tuple Change open(cmd) to return Process instead of Tuple May 2, 2017
@tkelman tkelman dismissed their stale review May 2, 2017 20:57

deprecations moved

@vtjnash vtjnash merged commit 0cc2b96 into master May 8, 2017
@vtjnash vtjnash deleted the jn/open_cmd_process branch May 8, 2017 02:31
@tkelman tkelman added the needs news A NEWS entry is required for this change label May 8, 2017
tkelman added a commit that referenced this pull request May 13, 2017
missed from #12807, only happens when running in mintty
tkelman added a commit that referenced this pull request May 14, 2017
missed from #12807, only happens when running in mintty
tkelman added a commit that referenced this pull request May 14, 2017
missed from #12807, only happens when running in mintty
@amitmurthy
Copy link
Contributor

Docstring here

Start running `command` asynchronously, and return a tuple `(stream,process)`. If `mode` is
needs to be updated.

omus added a commit to JuliaTesting/Mocking.jl that referenced this pull request Oct 31, 2017
@rened
Copy link
Member

rened commented Mar 26, 2018

Just fyi, the above docstring is still the old one, needs updating.

@bicycle1885
Copy link
Member

This is the pull request I made long before to fix the docstring: #25563.

@KristofferC KristofferC removed the needs news A NEWS entry is required for this change label Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:breaking This change will break code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use of open() results or filehandles
9 participants