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

Improve error message when the type is not bytes #6

Merged
merged 1 commit into from
Jun 14, 2016
Merged

Improve error message when the type is not bytes #6

merged 1 commit into from
Jun 14, 2016

Conversation

zkanda
Copy link
Contributor

@zkanda zkanda commented Jun 14, 2016

Fixes #5
This work on both Python 2 and 3 but I'm not sure what a proper test for it.

A simple test like this would work in py3 but fails in py2 because data is both str and bytes:

def test_input_should_be_bytes():
     data = '3vQB7B6MrGQZaxCuFg4oH'
     with assert_raises(TypeError):
         b58encode(data)

@keis keis merged commit 5c24b8e into keis:master Jun 14, 2016
@keis
Copy link
Owner

keis commented Jun 14, 2016

Thanks @zkanda

Added that tests but with a unicode string which should properly fail on both 2 and 3.

keis added a commit that referenced this pull request Jun 14, 2016
keis added a commit that referenced this pull request Jun 14, 2016
keis added a commit that referenced this pull request Jun 14, 2016
Improve error message when the type is not bytes
keis added a commit that referenced this pull request Jun 14, 2016
Improve error message when the type is not bytes
dannywillems pushed a commit to dannywillems/base58 that referenced this pull request Mar 12, 2019
Improve error message when the type is not bytes
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

2 participants