python-quickbooks
python-quickbooks copied to clipboard
simplejson optional
Hello, great lib. Super nice and easy.
Any chance simplejson
dependency can be made optional, pretty please?
Apparently everything in my app uses simplejson
if it exists, and I can't figure out the endless decode errors.
Thank you.
Not sure if that is possible. Maybe I can help with your problem. If you will add your error to this issue, I will take a look.
This was super confusing because the errors were happening in places I was already catching and sometimes expecting a JSONDecodeError
.
Basically, none of my code places like below work anymore.
from json import JSONDecodeError
try:
data = json.loads(data)
except JSONDecodeError:
pass
I would have to change them all to simplejson.errors.JSONDecodeError
.
From my reading, simplejson
is not used anymore in python3. And all major libs at most, make it optional.
Or remove it entirely. https://github.com/psf/requests/issues/3052
@ej2 I second this, in a Py3 environment simplejson makes little sense. It's a pity because requests will start using it if it finds it installed and then breaks tests in funny ways. Could you consider a PR that removes simplejson
?
Absolutely @pablogamboa.
Sent a PR that removes simplejson @ej2 added rationale in the PR description. PTAL 🙏