Page MenuHomePhabricator

Extracts API returning invalid JSON for Telugu Wikipedia
Closed, DuplicatePublic

Description

When I access this API url with Python's urlopen, I get an unloadable JSON string that ends with the invalid bytes: \x85\x016\x9b\x7f\x00\x00.

Just try:

import json
from urllib2 import urlopen

resp_bytes = urlopen(URL_FROM_LINK_ABOVE).read()

# uncomment the following to see the exact error
# json.loads(resp_bytes)

The response is also a rather suspicious length: 32,768 bytes. Tested on Python 2.7.6 and 2.7.5 on Ubuntu 14.04 and Debian 6.0.8.

Thanks in advance!