Fix two bugs in printing bytes instance #1296
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug 1:
When
value
isNone
, trying to calllen(None)
throws an exception.Bug 2:
When
len(value) <= 100
, the code currently printsb''
rather thanvalue
.@asdaraujo I cherry-picked this commit from your other PR, as I want to make sure fixes for both of these issues land, and I think the pytest will be a longer journey. I marked you as the commit author to give you credit for finding this issue, if you prefer otherwise I can change it.
@tvoinarovskyi can you review since you wrote this code originally? You normally pay attention to these kinds of details and sometimes use techniques I'm not familiar with, so want to make sure this isn't something you did on purpose...