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

Issue comparing bytes #60

Closed
moloney opened this issue Mar 14, 2017 · 3 comments
Closed

Issue comparing bytes #60

moloney opened this issue Mar 14, 2017 · 3 comments
Assignees
Labels

Comments

@moloney
Copy link

moloney commented Mar 14, 2017

In python 3.5 I get the following error when trying to diff two objects that contain byte strings:

site-packages/deepdiff/diff.py in __diff_str(self, level)
    904 
    905         # do we add a diff for convenience?
--> 906         if '\n' in level.t1 or '\n' in level.t2:
    907             diff = difflib.unified_diff(
    908                 level.t1.splitlines(), level.t2.splitlines(), lineterm='')

TypeError: a bytes-like object is required, not 'str'

I guess you need to use b'\n' if the element is a byte string.

seperman added a commit that referenced this issue Apr 11, 2017
BF+TST: Fix issues with bytes/unicode when diffing text (issue #60)
@seperman seperman added this to the V3.5 milestone May 29, 2017
@seperman
Copy link
Owner

@moloney Thanks for reporting this bug. I will look into it asap.

@seperman seperman added the bug label May 29, 2017
@seperman seperman self-assigned this May 29, 2017
@moloney
Copy link
Author

moloney commented May 31, 2017

This was actually fixed in my PR #61

@seperman
Copy link
Owner

seperman commented Jun 7, 2017

oh! right. Thanks for the PR!

@seperman seperman closed this as completed Jun 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants