-
Notifications
You must be signed in to change notification settings - Fork 58
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
monkey.py default
should use bounded default
method.
#323
Labels
Comments
brainix
added a commit
that referenced
this issue
Jan 25, 2021
Previously, our JSON encoder monkey patch was to an unbound method. This resulted in throwing a misleading `TypeError` when trying to encode something non-encodable.
brainix
added a commit
that referenced
this issue
Jan 25, 2021
Previously, our JSON encoder monkey patch was to an unbound method. This resulted in throwing a misleading `TypeError` when trying to encode something non-encodable.
brainix
added a commit
that referenced
this issue
Jan 25, 2021
Previously, our JSON encoder monkey patch was to an unbound method. This resulted in throwing a misleading `TypeError` when trying to encode something non-encodable.
brainix
added a commit
that referenced
this issue
Jan 25, 2021
Previously, our JSON encoder monkey patch was to an unbound method. This resulted in throwing a misleading `TypeError` when trying to encode something non-encodable.
brainix
added a commit
that referenced
this issue
Jan 25, 2021
Previously, our JSON encoder monkey patch was to an unbound method. This resulted in throwing a misleading `TypeError` when trying to encode something non-encodable.
brainix
added a commit
that referenced
this issue
Jan 25, 2021
I've released Pottery 1.1.1 which includes this fix. 🙂 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, monkey.py calls
_default.default(obj)
.But,
_default.default
isjson.JSONEncoder.default
, which is an unbounded method, so it needs two arguments for a successful call. A possible solution is to define_default.default = json.JSONEncoder().default
instead.How to reproduce:
Will throw an error
Instead of an error
The text was updated successfully, but these errors were encountered: