We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please specify the type of the issue you want to submit:
Please specify the following things:
sure
Python 2.7.13 (default, Mar 17 2017, 16:37:30) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Please specify the steps to reproduce your issue including the expected and the actual results.
% cat test_sure_bytes.py import base64 from unittest import TestCase import sure # noqa class TestBytesCompare(TestCase): def setUp(self): data_b64 = ( 'MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg11zwkcKSsSppm8Du13' 'je6lmwR7hEVeKMw5L8NQEN/CehRANCAAT9RzcGN/S9yN7mWP+xfLGEuw/TyHRBiW4c' 'GE6AczRgske/P8eq8trs8unSJPCp0YPKrmCEcuotL/8BHQ4Y1AVK' ) self.data = base64.b64decode(data_b64) def tearDown(self): pass def test_bytes_compare(self): self.data.should.equal(self.data) % nosetests test_sure_bytes.py E ====================================================================== ERROR: test_bytes_compare (test_sure_bytes.TestBytesCompare) ---------------------------------------------------------------------- Traceback (most recent call last): File "/private/tmp/sure-test/test_sure_bytes.py", line 22, in test_bytes_compare self.data.should.equal(self.data) File "/Users/cdunham/.pyenv/versions/2.7.13/envs/sure-test-2.7.13/lib/python2.7/site-packages/sure/__init__.py", line 384, in wrapper value = func(self, *args, **kw) File "/Users/cdunham/.pyenv/versions/2.7.13/envs/sure-test-2.7.13/lib/python2.7/site-packages/sure/__init__.py", line 650, in equal comparison = DeepComparison(self.obj, what, epsilon).compare() File "/Users/cdunham/.pyenv/versions/2.7.13/envs/sure-test-2.7.13/lib/python2.7/site-packages/sure/core.py", line 238, in compare safe_X, safe_Y = safe_format_repr(X), safe_format_repr(Y) File "/Users/cdunham/.pyenv/versions/2.7.13/envs/sure-test-2.7.13/lib/python2.7/site-packages/sure/core.py", line 232, in safe_format_repr safe_repr = string.replace('{', '{{').replace('}', '}}') UnicodeDecodeError: 'ascii' codec can't decode byte 0x81 in position 1: ordinal not in range(128) ---------------------------------------------------------------------- Ran 1 test in 0.002s FAILED (errors=1)
The text was updated successfully, but these errors were encountered:
Thanks for the report!
Unfortunately, I am on vacations until thursday and can not provide a fix. Maybe @gabrielfalcao can have a look at it? Or I can review a PR ...
Sorry, something went wrong.
I've finally found time to fix this issue. See #137
I'll release v1.4.6 in a few 🎉
713df6e
Merge pull request #137 from timofurrer/issue-136
1ed671e
Fix safe representation in exception messages for bytes and unicode objects. Closes #136
No branches or pull requests
Issue Type
Please specify the type of the issue you want to submit:
Versions & Configuration
Please specify the following things:
sure
: 1.4.5Steps to reproduce (Expected and Actual Results)
Please specify the steps to reproduce your issue including the expected and the actual results.
The text was updated successfully, but these errors were encountered: