ValueError: Unrecognized escape sequence when decoding 'string' #52

Closed
thongly opened this Issue Jul 29, 2012 · 5 comments

Projects

None yet

2 participants

@thongly

Further to this thread: #44 (comment)

I've isolated a specific cause of this, which can be avoided in cjson through the 'all_unicode=True' option. Hopefully this will help with a solution.

Names such as "Abercrombie \x26 Fitch Co." cause this error in ujson:

j = json.decode(feed)

Traceback (most recent call last):
File "", line 1, in
ValueError: Unrecognized escape sequence when decoding 'string'

@jskorpan
ESN Social Software member
@thongly

Hi - I would say a minimal test would be to try and parse this. The unicode issue seems to be what's breaking it.

http://www.google.com/finance/info?infotype=infoquoteall&q=ANF:NYSE

Compare it with something like:

http://www.google.com/finance/info?infotype=infoquoteall&q=GOOG:NASDAQ

@jskorpan
ESN Social Software member
@thongly

Is there any way to account for this similar to CJSON? I'd contribute myself, but my knowledge of C is weak to say the least.

@jskorpan
ESN Social Software member
@jskorpan jskorpan closed this Sep 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment