Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71540

problems decoding json objects

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <th982a@googlemail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'column': 0.07; 'json': 0.07; 'data:': 0.09; 'valueerror:': 0.09; '(char': 0.16; '107': 0.16; 'json.decoder': 0.16; 'string:': 0.16; 'subject:problems': 0.16; 'charset:iso-8859-15': 0.16; '>>>': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'skip:" 30': 0.26; 'raise': 0.29; '"",': 0.31; 'end,': 0.31; 'file': 0.32; '(most': 0.33; 'problem': 0.35; 'received:google.com': 0.35; 'thanks': 0.36; 'from:addr:googlemail.com': 0.38; 'to:addr:python-list': 0.38; 'recent': 0.39; 'help,': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'solve': 0.60
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=BuyX6ua7L1sdfXag4w2qxYhyhJoFAvC5g3NBdLvBtjA=; b=habHyLOC6w84++m6shKZtEcFguunAqmfI4fOAYtkbeY0bIkH3wqwXPieyuUs6hrs8j soCifYGZLIQJb3hwKBbtcf6n0uwKwdy1cPki6hdp/oQ+F52GfSoqXguxuFJZvty1WlE+ 7XmGmJtIpbDtwK4BfCLKZ4QvaIcu4EPXwUOIVcb9hzSM4AjjDJqjW+gnJhn9A4BZBHnT CaHj+8ihgBaSksoistluQODUjwrqtzdOAUMpZY2RaHTO0607alF6YhoSrR5e9jTBhPAj asd+facjFDMbuK42Ym9YghYdq8UfwJjX1H4G031wSB1bouqBVtovel9JUUHv2OD+PAP+ Vhaw==
X-Received by 10.15.50.136 with SMTP id l8mr2413809eew.73.1400056572696; Wed, 14 May 2014 01:36:12 -0700 (PDT)
Date Wed, 14 May 2014 10:36:11 +0200
From Tamer Higazi <th982a@googlemail.com>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1
MIME-Version 1.0
To python-list@python.org
Subject problems decoding json objects
X-Enigmail-Version 1.5.2
Content-Type text/plain; charset=ISO-8859-15
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.9992.1400057914.18130.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1400057914 news.xs4all.nl 2908 [2001:888:2000:d::a6]:44574
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:71540

Show key headers only | View raw


Hi people!

My JSON String:

from json.decoder import JSONDecoder


myjs =
'{"AVName":"Tamer","ANName":"Higazi","AAnschrift":"Bauerngasse","AHausnr":"1","APLZ":"55116","AOrt":"Mainz"},{"KontaktTel":["01234","11223344"],{"ZahlungsArt":"0"},{"ZugangsDaten":["tamer.higazi@nomail.com","mypass"]}'

If I try to decode it, with:

JSD = JSONDecoder()
rsx = JSD.decode(myjs)

I get this error message:

>>> JSD.decode(myjs)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/json/decoder.py", line 368, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 1 column 108 - line 1 column 220 (char 107
- 219)



How do I solve this problem ?!


For any help, thanks



Tamer

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

problems decoding json objects Tamer Higazi <th982a@googlemail.com> - 2014-05-14 10:36 +0200
  Re: problems decoding json objects Denis McMahon <denismfmcmahon@gmail.com> - 2014-05-14 12:04 +0000

csiph-web