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

repr output problem: �� is not JSON serializable #258

Closed
mosquito opened this issue Mar 24, 2017 · 6 comments · Fixed by #382
Closed

repr output problem: �� is not JSON serializable #258

mosquito opened this issue Mar 24, 2017 · 6 comments · Fixed by #382

Comments

@mosquito
Copy link

mosquito commented Mar 24, 2017

ujson segmentation fault (python 3.5.2)

ujson==1.35
yarl==0.10.0
In [1]: import ujson
In [2]: from yarl import URL
In [3]: ujson.dumps(URL(''))
zsh: abort      ipython
@Jahaja
Copy link
Contributor

Jahaja commented Mar 29, 2017

Hi, do you get this issue using the latest version from master?

@mosquito
Copy link
Author

It's better but so strange:

In [1]: import ujson, yarl
In [2]: ujson.dumps(yarl.URL(""))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-fd63a1f1204c> in <module>()
----> 1 ujson.dumps(yarl.URL(""))

TypeError: 䠯 is not JSON serializable

In [3]: ujson.dumps(yarl.URL("http://me.com"))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-c5b65a41fa83> in <module>()
----> 1 ujson.dumps(yarl.URL("http://me.com"))

TypeError: � is not JSON serializable

In [4]: ujson.dumps(yarl.URL("http://me.com"))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-c5b65a41fa83> in <module>()
----> 1 ujson.dumps(yarl.URL("http://me.com"))

TypeError: �� is not JSON serializable

I try to run it forever:

In [28]: while True:
    ...:     try:
    ...:         ujson.dumps(yarl.URL("http://ya.ru"))
    ...:     except:
    ...:         pass
    ...:

^Czsh: segmentation fault  ipython

But after sending interrupt signal the ipython was chased.

@mosquito
Copy link
Author

mosquito commented Mar 29, 2017

$ pip list --format=columns
Package    Version
---------- --------
appdirs    1.4.3
multidict  2.1.4
packaging  16.8
pip        9.0.1
pyparsing  2.2.0
setuptools 34.3.3
six        1.10.0
ujson      2.0
wheel      0.30.0a0
yarl       0.10.0

@Jahaja
Copy link
Contributor

Jahaja commented Mar 29, 2017

It think it will solve your original problem. But yeah, there seems to be an issue with the repr output in the exception generated in your case.

@mosquito
Copy link
Author

Looks like the repr it's a garbage from memory.

@hugovk
Copy link
Member

hugovk commented Mar 13, 2020

Please see PR #382 for a fix.

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

Successfully merging a pull request may close this issue.

3 participants