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

Improve error reporting during package name fetching #88

Merged
merged 1 commit into from
Aug 21, 2018
Merged

Improve error reporting during package name fetching #88

merged 1 commit into from
Aug 21, 2018

Conversation

miguelsousa
Copy link
Contributor

@miguelsousa miguelsousa commented Aug 21, 2018

Fixes #87

@joerick
Copy link
Contributor

joerick commented Aug 21, 2018

Nice one. Thank you!

@YannickJadoul
Copy link
Member

YannickJadoul commented Aug 21, 2018

Should/could we make a test that this actually works? Because the Python docs say that CalledProcessError.output contains Output of the child process if it was captured by run() or check_output(). Otherwise, None., and I don't see the output being captured?

EDIT: And a quick test seems to indicate nothing is captured, but then it's getting late in this time zone, so there's a reasonably-sized chance I'm missing something...
Either, way, the alternative would be to pass stderr=sys.stderr to the check_output call.

@miguelsousa miguelsousa deleted the show-err-output branch August 22, 2018 00:19
@miguelsousa
Copy link
Contributor Author

@YannickJadoul I tested these changes with our repo and got the expected results. See https://ci.appveyor.com/project/adobe-type-tools/afdko/build/1.0.1115

cibuildwheel --output-dir wheelhouse
setup requires that the Python package 'wheel' be installed. Try the command 'pip install wheel'.

cibuildwheel: Failed to get name of the package. Command was ['c:\\python27\\python.exe', '.\\setup.py', '--name']
Command exited with code 1

The first message and the return code came from https://github.com/adobe-type-tools/afdko/blob/da379f5e143b471faaa370c6494471b4118ba408/setup.py#L29

I'm all in favor of adding test cases along with any code changes, but in this case I'm not sure how to craft one.

@YannickJadoul
Copy link
Member

@miguelsousa Sorry, I missed the part where the documentation says that check_output does capture the stdout (If the return code was non-zero it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute and any output in the output attribute.). And since the stderr is not captured, I guess that's just printed as well.

So, sorry again, and thanks for the fix! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants