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

[BUG]: json.dumps failed on object with new _pybind11_conduit_v1 method #5377

Open
2 of 3 tasks
anmyachev opened this issue Sep 17, 2024 · 0 comments
Open
2 of 3 tasks
Labels
triage New bug, unverified

Comments

@anmyachev
Copy link

anmyachev commented Sep 17, 2024

Required prerequisites

What version (or hash if on master) of pybind11 are you using?

2.13.6

Problem description

A new self._pybind11_conduit_v1_() method that is added to all classes by default breaks the serialization of this object through json.dumps([object with _pybind11_conduit_v1], default=vars). I would like to clarify whether this is by mistake or intentional, considering also that this is a patch release. Thanks!

The error:

  File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/triton/compiler/compiler.py", line 315, in compile
    metadata_group[metadata_filename] = fn_cache_manager.put(json.dumps(metadata, default=vars), metadata_filename,
  File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/json/__init__.py", line 234, in dumps
    return cls(
  File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
TypeError: vars() argument must have __dict__ attribute

Reproducible example code

Since this should be a problem with any object, and I have no experience with `pybind`, I will leave it without a reproducer for now, but if it is not so easy to reproduce, I may try to make one.

Is this a regression? Put the last known working version here if it is.

2.13.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage New bug, unverified
Projects
None yet
Development

No branches or pull requests

1 participant