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

add safety wrapper around sys.stdout assignment #724

Merged
merged 4 commits into from
Jan 5, 2018
Merged

add safety wrapper around sys.stdout assignment #724

merged 4 commits into from
Jan 5, 2018

Conversation

tonybaloney
Copy link

@tonybaloney tonybaloney commented Jan 4, 2018

See #723 for details on why this PR is being raised

Contribution checklist:

(also see CONTRIBUTING.rst for details)

  • wrote descriptive pull request text
  • added/updated test(s)
  • updated/extended the documentation
  • added relevant issue keyword
    in message body
  • added news fragment in changelog folder
    • fragment name: <issue number>.<type>.rst for example (588.bugfix.rst)
    • <type> is must be one of bugfix, feature, deprecation,breaking, doc, misc
    • if pr has no issue: consider creating one first or change it to the pr number after creating the pr
    • "sign" fragment with "by @"
    • please use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files - by @superuser."
    • also see examples
  • added yourself to CONTRIBUTORS (preserving alphabetical order)

@gaborbernat
Copy link
Member

Looks okay, but make sure to add news fragment, and add issue it solves in commit message.

Copy link
Contributor

@asottile asottile left a comment

Choose a reason for hiding this comment

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

Thanks for the patch! Definitely agree with the idea, just a few tiny things to fix up and then we can merge this :)

tox/venv.py Outdated
redirect=self.session.report.verbosity < 2)
sys.stdout = old_stdout
try:
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be outside of the try I think?

Copy link
Author

Choose a reason for hiding this comment

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

changed in 69e05ac

tox/venv.py Outdated
self._pcall(argv, cwd=self.envconfig.config.toxinidir, action=action,
redirect=self.session.report.verbosity < 2)
except Exception:
raise
Copy link
Contributor

Choose a reason for hiding this comment

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

can remove these two lines, they do nothing try: finally: is valid.

Copy link
Author

Choose a reason for hiding this comment

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

changed in 69e05ac

@codecov
Copy link

codecov bot commented Jan 4, 2018

Codecov Report

Merging #724 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #724   +/-   ##
=======================================
  Coverage   94.93%   94.93%           
=======================================
  Files          11       11           
  Lines        2427     2427           
=======================================
  Hits         2304     2304           
  Misses        123      123

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e09189...b33d6d5. Read the comment docs.

@tonybaloney
Copy link
Author

@gaborbernat added changelog entry in b33d6d5

Anything else required for this PR?

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