Skip to content

cjson dose not decode \/ properly #60560

Description

@RichardDelorenzi
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']

Activity

  1. RichardDelorenzi commented on Oct 29, 2012

    RichardDelorenzimannequin
    MannequinAuthor

    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

  2. tiran commented on Oct 29, 2012

    @tiran
    Member

    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

  3. ezio-melotti commented on Oct 29, 2012

    @ezio-melotti
    Member
    This works fine with the standard json module.
    >>> json.loads(json.dumps('/'))
    '/'

    FWIW 'json' also has C accelerations.

  4. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions