Skip to content
This repository was archived by the owner on Apr 20, 2025. It is now read-only.

Conversation

@jdufresne
Copy link
Contributor

Shouldn't try to coerce bytes to a string. Instead, print the repr value (e.g. b'mybytestring').

When running tests with the Python -b option, fixes warnings of the form:

.../python-rsa/tests/test_strings.py:34: BytesWarning: str() on a bytes instance
  print("\tMessage:   %s" % message)
.../python-rsa/tests/test_strings.py:37: BytesWarning: str() on a bytes instance
  print("\tEncrypted: %s" % encrypted)
.../python-rsa/tests/test_strings.py:40: BytesWarning: str() on a bytes instance
  print("\tDecrypted: %s" % decrypted)

Shouldn't try to coerce bytes to a string. Instead, print the repr
value (e.g. b'mybytestring').

When running tests with the Python `-b` option, fixes warnings of the
form:

.../python-rsa/tests/test_strings.py:34: BytesWarning: str() on a bytes instance
  print("\tMessage:   %s" % message)
.../python-rsa/tests/test_strings.py:37: BytesWarning: str() on a bytes instance
  print("\tEncrypted: %s" % encrypted)
.../python-rsa/tests/test_strings.py:40: BytesWarning: str() on a bytes instance
  print("\tDecrypted: %s" % decrypted)
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 88.466% when pulling eeb95c9 on jdufresne:bytes-warning into 368a31f on sybrenstuvel:master.

@sybrenstuvel
Copy link
Owner

Merged in 7424c69, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants