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

Unsupported Operation: readline + Debug Feature #411

Open
SoundsSerious opened this issue Jul 29, 2023 · 2 comments
Open

Unsupported Operation: readline + Debug Feature #411

SoundsSerious opened this issue Jul 29, 2023 · 2 comments

Comments

@SoundsSerious
Copy link

I have a bug that I cannot resolve what is causing is it.

Somewhere deep in my object I see that I have a file reference that I cannot resolve. Ignore encoding errors doesn't work as well.

deepdiff.DeepHash(vs,ignore_encoding_errors=True)

Results in a trace:

File ~/miniconda3/envs/nept/lib/python3.10/site-packages/deepdiff/deephash.py:514, in DeepHash._hash(self, obj, parent, parents_ids)
    511     result, counts = self._prep_tuple(obj=obj, parent=parent, parents_ids=parents_ids)
    513 elif isinstance(obj, Iterable):
--> 514     result, counts = self._prep_iterable(obj=obj, parent=parent, parents_ids=parents_ids)
    516 elif obj == BoolObj.TRUE or obj == BoolObj.FALSE:
    517     result = 'bool:true' if obj is BoolObj.TRUE else 'bool:false'

File ~/miniconda3/envs/nept/lib/python3.10/site-packages/deepdiff/deephash.py:405, in DeepHash._prep_iterable(self, obj, parent, parents_ids)
    402 counts = 1
    403 result = defaultdict(int)
--> 405 for i, item in enumerate(obj):
    406     new_parent = "{}[{}]".format(parent, i)
    407     if self._skip_this(item, parent=new_parent):

UnsupportedOperation: readline

In this case I would hope that I could add a debug flag so as to get to the bottom of the object, so i could apply rules to filter it using the existing functionality.

  • OS: Ubuntu
  • Version 20 LTS
  • Python Version 3.10
  • DeepDiff Version 6.3.1

Thanks!

@seperman
Copy link
Owner

Hi @SoundsSerious
Cool username. Sorry it took me a while to see your report.
Without having reproducible code, it is difficult to pin point the problem. It may be a file object you have that does not have a readline method.

@seperman
Copy link
Owner

Hi @SoundsSerious
Please post reproducible code. Otherwise, I will close this ticket due to inactivity. I can't help you if I can't reproduce it!

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