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

cjson dose not decode \/ properly #60560

Closed
RichardDelorenzi mannequin opened this issue Oct 29, 2012 · 3 comments
Closed

cjson dose not decode \/ properly #60560

RichardDelorenzi mannequin opened this issue Oct 29, 2012 · 3 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@RichardDelorenzi
Copy link
Mannequin

RichardDelorenzi mannequin commented Oct 29, 2012

BPO 16356
Nosy @tiran, @ezio-melotti

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2012-10-29.14:24:23.281>
created_at = <Date 2012-10-29.14:21:13.607>
labels = ['type-bug', 'invalid']
title = 'cjson dose not decode \\/ properly'
updated_at = <Date 2012-10-29.14:41:45.273>
user = 'https://bugs.python.org/RichardDelorenzi'

bugs.python.org fields:

activity = <Date 2012-10-29.14:41:45.273>
actor = 'ezio.melotti'
assignee = 'none'
closed = True
closed_date = <Date 2012-10-29.14:24:23.281>
closer = 'christian.heimes'
components = ['None']
creation = <Date 2012-10-29.14:21:13.607>
creator = 'Richard.Delorenzi'
dependencies = []
files = []
hgrepos = []
issue_num = 16356
keywords = []
message_count = 3.0
messages = ['174114', '174115', '174117']
nosy_count = 3.0
nosy_names = ['christian.heimes', 'ezio.melotti', 'Richard.Delorenzi']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue16356'
versions = ['3rd party']

@RichardDelorenzi
Copy link
Mannequin Author

RichardDelorenzi mannequin commented Oct 29, 2012

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

@RichardDelorenzi RichardDelorenzi mannequin added the type-bug An unexpected behavior, bug, or error label Oct 29, 2012
@tiran
Copy link
Member

tiran commented Oct 29, 2012

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

@tiran tiran closed this as completed Oct 29, 2012
@tiran tiran added the invalid label Oct 29, 2012
@ezio-melotti
Copy link
Member

This works fine with the standard json module.
>>> json.loads(json.dumps('/'))
'/'

FWIW 'json' also has C accelerations.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants