-
Notifications
You must be signed in to change notification settings - Fork 745
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
UTF-8 encoded strings #185
Comments
It is not that your function does not accept UTF-8 encoded strings, it is that it does accept bytestrings (ìt will fail with If you want to accept only bytestrings, use You could also probably do the type check on the Python side, and use |
Kudos for the test repository, that's how I figured it out ! 😉 |
Thanks! I'll try that. Just saw that the official |
If I'm not mistaken, all CPython functions do because there's no downcast from Python |
I'm writing a
json
-module compatible library for encoding and decoding JSON.The following input string works with
json
, but not with my module:💥 Reproducing
This repository contains a demonstration of the issue.
The
loads
function takes a&str
as an input parameter. Maybe I have to change that to a different type in order to avoid theTypeError
or maybe cast it to a different type.🌍 Environment
Any idea would be very much appreciated.
The text was updated successfully, but these errors were encountered: