New submission from Jeffrey Finkelstein <jeffrey.finkelst...@gmail.com>:
The following code produces an error: # APIKEY defined above r = urllib.request.urlopen('http://api.billboard.com/apisvc/chart/v1/' 'list/spec?api_key={}&format=JSON' .format(APIKEY)) j = json.load(r) Specifically, the urlopen() function returns a request object that can be read, the request object returns a bytes object containing JSON, and the json.load() function tries to mix str and bytes objects when using the re module. json.load() should convert bytes to str. It is reasonable that one should be able to open a url and pass the result directly to json.load(). ---------- components: Library (Lib) messages: 120960 nosy: jfinkels priority: normal severity: normal status: open title: json.load should handle bytes input type: feature request versions: Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10390> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com