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

Handle sys.stdout.encoding being None in get_style() #204

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

devdanzin
Copy link
Collaborator

If sys.stdout is a StringIO instance, sys.stdout.encoding will be None and wily.helper.get_style() will error out due to trying to call .lower() on it. This PR adds a check to handle that case.

Found while updating #199, due to a test that mocked stdout in this way.

@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2023

Codecov Report

Merging #204 (048a5db) into master (d501d01) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #204   +/-   ##
=======================================
  Coverage   95.42%   95.43%           
=======================================
  Files          24       24           
  Lines        1269     1270    +1     
  Branches      287      287           
=======================================
+ Hits         1211     1212    +1     
  Misses         33       33           
  Partials       25       25           
Files Changed Coverage Δ
src/wily/helper/__init__.py 100.00% <100.00%> (ø)

@tonybaloney tonybaloney merged commit 594abe2 into tonybaloney:master Aug 3, 2023
19 checks passed
@devdanzin devdanzin deleted the fix_none_encoding branch August 3, 2023 11:46
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