Skip to content

RecursionError where using non UTF-8 character #227

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

Closed
see-gshefer opened this issue Feb 11, 2021 · 3 comments
Closed

RecursionError where using non UTF-8 character #227

see-gshefer opened this issue Feb 11, 2021 · 3 comments

Comments

@see-gshefer
Copy link

Describe the bug
RecursionError where using non UTF-8 character

To Reproduce

import deepdiff

x = {
    "x": {
        "y": [
            "aaaaaa\u0142 bbbbb"
        ]
    }
}

result = x | deepdiff.grep({'foo': 'bar'}, verbose_level=2)

Expected behavior
return matched results as usual

OS, DeepDiff version and Python version (please complete the following information):

  • OS: MacOS BigSur
  • Python 3.8.6

Additional context
Got Recursion error:
RecursionError: maximum recursion depth exceeded in comparison

@seperman
Copy link
Owner

@see-gshefer
Thanks for reporting this bug. I have made a fix and will post you once that is published. Just one note: grep is not very useful when you are searching for a nested object inside another nested object. The reason is that grep will convert your {'foo': 'bar'} into a string of "{'foo': 'bar'}" when searching. It works correctly when searching for integers or strings inside a nested object though:

    def test_number_in_list2(self):
        obj = ["a", "10", 10, 20]
        item = 10
        result = {"matched_values": {'root[2]'}}
        assert DeepSearch(obj, item, verbose_level=1) == result

    def test_number_in_list3(self):
        obj = ["a", "10", 10, 20]
        item = "10"
        result = {"matched_values": {'root[1]'}}
        assert DeepSearch(obj, item, verbose_level=1) == result

@seperman
Copy link
Owner

@see-gshefer this feature is released in DeepDiff 5.2.3
https://twitter.com/sep_dehpour/status/1361774255050870789
Thanks.

@see-gshefer
Copy link
Author

Thanks!!!

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

No branches or pull requests

2 participants