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

Using sys.stdout as keyword default messes up stdout capture for downstream packages #1330

Closed
bnavigator opened this issue Jul 19, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@bnavigator
Copy link

Keyword defaults are evaluated at import time, not at call time. This makes trying to capture sys.stdout output of isort.api calls with show_diff=True difficult. (regression through #1189)

https://github.com/timothycrosley/isort/blob/447580671b2e37a21a3cf1a4d2e80c387f9af98a/isort/format.py#L31-L33

See also
gforcada/flake8-isort#92 (comment)

@timothycrosley timothycrosley added the bug Something isn't working label Jul 20, 2020
@timothycrosley
Copy link
Member

Thanks for reporting this issue and your great work on fixing flake8-isort compatibility! I've fixed the regression in the 5.1.4 patch release, and I think fixed the underlying issue of there being no official mechanism to capture the diff in development slated for the 5.2.0 release: #1335

Thanks!

~Timothy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants