-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Create a custom call_subprocess for vcs commands avoiding merging of stdout and stderr, and introduces a new SubprocessError exception #7969
Conversation
7943a4f
to
ae85692
Compare
Could you try whether the version is the first line of stdout though? If it is, the proper fix would be to re-implement |
Hi @uranusjr If I understand correctly, you want me to try out the following.
I tried it and I got the following output
As you can see, even with |
In
I'm not sure what's the cost of changing this hard-coded behavior though. BTW if we still going in the direction of just fixing svn version parser, why not using regex, e.g. def call_vcs_version(self):
match = re.search('^svn, version (\d+(?:\.\d+)*)\s', a)
if match is None:
return ()
return tuple(map(int, match.group(1).split('.'))) |
My suggestion would be to re-implement |
Hi @uranusjr So if I understand correctly, we want to use subprocess.Popen directly here instead of using Okay I will investigate it and make necessary changes, while making sure the vcs based tests still pass. BTW I see that the parameters of I know that we have to use |
690522a
to
f52b538
Compare
Hi @uranusjr So as per your suggestion, I have made a copy of However apart from |
Hi @uranusjr , Would appreciate your thoughts on the changes in the PR, especially the comment above #7969 (comment), so that it can be moved forward towards more implementation reviews, or if there are better ways to achieve what I am trying to do here. |
2e5e914
to
ebddafa
Compare
I have gone ahead and dropped Please review the changes and let me know if anything else is needed, especially what do we want to do with |
It just now occurs to me, we need to add something to catch the |
If my memory serves me right, I assume you are referring to the PR #8133 in the above comment which is currently approved and done by @gutsytechster ? (I see that in the PR, a new |
Added 53cc0d7 for this by catching Please let me know if this was the change you mentioned to add, or did I miss something.
|
The output looks right to me (yay) |
Thanks, Are there any other changes needed here? If no, could I please get the PR approved. (Would also appreciate your thoughts on how to better reword the news entry, include the type, and if this even needs a news entry). |
e723cbc
to
4b111f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming CI passes
Thanks for the approval 😊 , and the CI passed too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR's title, and the changelog should probably be updated, to reflect everything that's being changed here.
The code change LGTM.
4b111f1
to
4f068c8
Compare
I think this should also fix:
If yes, I will go ahead and add these to the PR description, so that they will auto close once this is merged. Please do let me know if any of those PR are actually not being fixed here. I will also add a comment to each one of them mentioning this PR and how it was fixed once this is merged for completeness. |
@deveshks Sounds right to me. |
4f068c8
to
5c615aa
Compare
I'm gonna trust @uranusjr's judgement here, and merge this in. :) |
Revert #7969 and fix VCS stdout/stderr capture
Fixes and Closes #7968 , Closes #7841 , Closes #7711 and Closes #7545
It's not always guaranteed that the version string in the output of
svn --version
is present in the first line, which is currently what the code assumes, for e.g.This happens because we were using
utils.subproces.call_subprocess
in vcs, which merges stdout and stderr.This change creates a custom
call_subprocess
for vcs commands to avoid merging stdout and stderr, and introduces a newSubprocessError
exception to replace the olderInstallationError
being raised before.