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

Fix two bugs in printing bytes instance #1296

Merged
merged 1 commit into from
Nov 27, 2017

Conversation

jeffwidman
Copy link
Collaborator

@jeffwidman jeffwidman commented Nov 15, 2017

Bug 1:
When value is None, trying to call len(None) throws an exception.

Bug 2:
When len(value) <= 100, the code currently prints b'' rather than
value.

@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...

Bug 1:
When `value` is None, trying to call `len(None)` throws an exception.

Bug 2:
When len(`value`) <= 100, the code currently prints b'' rather than
`value`.
@tvoinarovskyi
Copy link
Collaborator

Yea, nothing on purpose, thanks.

Copy link

@brett-mobsby brett-mobsby left a comment

Choose a reason for hiding this comment

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

Thanks Jeff. I had both of these issues and this change resolves them.

@jeffwidman jeffwidman merged commit 27da916 into master Nov 27, 2017
@jeffwidman jeffwidman deleted the fix-minor-bug-with-printing-bytes-instance branch November 27, 2017 20:45
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.

4 participants