-
-
Notifications
You must be signed in to change notification settings - Fork 542
Fix RunResult unicode repr errors #1264
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
Conversation
if six.PY2: | ||
return res.encode("UTF-8") | ||
else: | ||
return res |
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.
can you make it one return?
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.
one less line
if six.PY2:
res = res.encode("UTF-8")
return res
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.
if
else
is easier for humans to parse as it's clearer that there are two disparate branches -- for maintenance reasons it's also easier to update if functionality were to be added as it's clearer it needs to happen at two places at a glance.
I've seen too many bugs from using your suggested style 😆
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.
something must be wrong with me then because for me two returns are a lot harder to understand, reason and parse 🤔 I think it's harder to maintain as now I need to update in two locations while I can clearly reduce the second to one, needing to worry only about a single case...
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.
your suggested pattern also makes mypy unhappy since it changes the type of the variable
Incompatible types in assignment (expression has type "bytes", variable has type "str")
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.
lol it's always something >.<
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.
it worked a while back now it's missing 💭
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.
microsoft/azure-pipelines-tasks#9962 turns out the ability to upload coverage report was removed 😆
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.
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.
whoa that's cool
Seems a flaky test 😢 |
No description provided.