-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
JSON type fails in Python 3 w/ any string, Python 2 w/ non-ascii data #488
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
Comments
Change-Id: I4f935cce878eb1678b432f4cb4ba6ee122f8e9d4
On Py2k, things don't work when there's unicode data present:
output: Traceback (most recent call last): |
master branch does not resolve, I still get bytes back on py3k, "'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128)" on py2k. I am also in some circumstances getting the error "(pymysql.err.InternalError) Packet sequence number wrong - got 5 expected 1" which I've also seen with previous versions though it is more difficul to reproduce. |
yeah that seems to have fixed thanks! |
Im still having some issues, not with the simple test here, ill try to make another test. |
here we go
py27 output:
|
PyMySQL respects encoding specified in column descriptor packet. In next major version (0.8), I will stop reading encoding in column descriptor. |
note. test 1column charsetnr=63 (binary) When changing connection encoding to 'latin1', charsetnr=binary, but contents is encoded in latin1. test 2column charsetnr=33 (utf8_general_ci) When changing connection encoding to 'latin1', charsetnr=8 (latin1_swedish_ci) |
* Fix SELECT CAST(... AS JSON) cause UnicodeError fixes #488
works great. Release! :) thanks for the great response time. |
Released 0.7.6 |
The JSON string comes back as bytes on Python 3 which is not what json.loads() expects. This is also inconsistent vs. mysqlclient. I'm not 100% sure there isn't something else that makes this work, since I had some trouble reproducing and I thought maybe it was working in 0.7.1, but now it's not working there either.
output:
The text was updated successfully, but these errors were encountered: