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

Issue with fallback encoder in the escape_item() function #65

Closed
Hardtack opened this issue Jun 2, 2023 · 0 comments
Closed

Issue with fallback encoder in the escape_item() function #65

Hardtack opened this issue Jun 2, 2023 · 0 comments

Comments

@Hardtack
Copy link
Contributor

Hardtack commented Jun 2, 2023

Since the v0.2.5 release, I have noticed a problem with the fallback encoder in the escape_item() function of the library. Previously, if I provided a value that was not directly listed in the encoder list, escape_item() would fall back to the default encoder, encode_str(), and it worked correctly. However, after the commit referenced here, a type declaration was added for encode_str(), which caused it to fail during type checks and can no longer be used as a default encoder.

I encountered this issue when using the FakeDate class from the freezegun library. FakeDate wraps datetime.date objects and relies on the default encoder.

To help address this issue, I plan to create a pull request that includes a reproduction of the problem.

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

1 participant