This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: cjson dose not decode \/ properly
Type: behavior Stage: resolved
Components: None Versions: 3rd party
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Richard.Delorenzi, christian.heimes, ezio.melotti
Priority: normal Keywords:

Created on 2012-10-29 14:21 by Richard.Delorenzi, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg174114 - (view) Author: Richard Delorenzi (Richard.Delorenzi) Date: 2012-10-29 14:21
This code produces the wrong result

import cjson
cjson.decode(cjson.encode('/'))

It produces '\\/', it should produce '/'

using
/usr/lib/pymodules/python2.7/cjson.so
cjson version 1.0.5-4build1
msg174115 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2012-10-29 14:24
cjson is a third party module and not part of Python's standard library. Please report the error to the author of the cjson package. 

Python 2.7 has a builtin json encoder and decoder. The package is called 'json'. http://docs.python.org/2.7/library/json.html#module-json
msg174117 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-10-29 14:41
This works fine with the standard json module.
>>> json.loads(json.dumps('/'))
'/'

FWIW 'json' also has C accelerations.
History
Date User Action Args
2022-04-11 14:57:37adminsetgithub: 60560
2012-10-29 14:41:45ezio.melottisetnosy: + ezio.melotti

messages: + msg174117
stage: resolved
2012-10-29 14:24:23christian.heimessetstatus: open -> closed
versions: + 3rd party, - Python 2.7
nosy: + christian.heimes

messages: + msg174115

resolution: not a bug
2012-10-29 14:21:13Richard.Delorenzicreate