-
Notifications
You must be signed in to change notification settings - Fork 127
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
Object of type WhistleBlowerDict is not JSON serializable #176
Comments
Hello @jxb5151, Which python version are you using? Can you share a reproducer script? I tried the following and it worked correctly: Python 3.11.7 (main, Dec 4 2023, 18:10:11) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import vt
>>> with vt.Client('xxxxx') as c:
... obj = c.get_object('/intelligence/hunting_rulesets/12345')
... c.patch_object('/intelligence/hunting_rulesets/12345', obj=obj)
...
<vt.object.Object hunting_ruleset 12345> Thanks! |
I'm having this same issue with Python 3.10.12. It can be reproduced by running |
Confirmed also using Python
Produces:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When attempting to update LiveHunt rules using the latest
0.18.0
version ofvt-py
I encountered the following error:The issue appears to have been introduced here:
https://github.com/VirusTotal/vt-py/pull/175/files
More specifically,
vt-py/vt/object.py
Line 25 in 944e58c
Where
collections.UserDict
was added instead ofdict
as a fix to support a separate issue. Unfortunately, this appears to introduce an issue with supported objects/types the in the Json module.More info:
https://stackoverflow.com/questions/70762125/why-is-class-that-extends-dict-json-serializable-but-one-that-extends-collectio
The following has additional info on extending it, if that is a route you want to go down:
https://stackoverflow.com/questions/57982946/how-to-register-implementation-of-abc-mutablemapping-as-a-dict-subclass
The text was updated successfully, but these errors were encountered: