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
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 breaking This change will break code label Aug 26, 2015
@StefanKarpinski
Copy link
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
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
Member

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

@vtjnash
Copy link
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
Member

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

@vtjnash vtjnash force-pushed the jn/open_cmd_process branch from 955fab4 to 422521d Compare August 26, 2015 23:04
@vtjnash
Copy link
Member Author

vtjnash commented Aug 26, 2015

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

@vtjnash vtjnash force-pushed the jn/open_cmd_process branch from 422521d to db79a03 Compare August 27, 2015 00:23
@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 vtjnash force-pushed the jn/open_cmd_process branch from db79a03 to 0712f9c Compare September 12, 2015 23:26
@vtjnash
Copy link
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
Member

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

@vtjnash
Copy link
Member Author

vtjnash commented Sep 14, 2015

The question was for master, not 0.4

@StefanKarpinski
Copy link
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
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
Member

Bump.

@StefanKarpinski
Copy link
Member

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

@vtjnash vtjnash force-pushed the jn/open_cmd_process branch from 0712f9c to 06a2be1 Compare April 24, 2017 22:16
@vtjnash
Copy link
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
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
@vtjnash vtjnash force-pushed the jn/open_cmd_process branch from 06a2be1 to 85f3fc7 Compare May 2, 2017 20:21
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
@vtjnash vtjnash force-pushed the jn/open_cmd_process branch from 85f3fc7 to 505dec5 Compare May 2, 2017 20:55
@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
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