On Sat, Oct 13, 2012 at 5:40 PM, Leo <sdl.web at gmail.com> wrote: > Use this script on a json file and observe all the trailing spaces > generated. (screenshot attached.) Confirmed as still the case in Python 3 (specifically, with an early alpha of 3.3 and with 3.2 for Windows). It's because the item separator is '; ' and the newline and indent are appended to that. That can be overridden with: json.dumps({"asdf":"123","qwer":"234","zxcv":"345"},indent=4,separators=(',',': ')) but that compacts everything, not sure if that's what you want. The code in question is in Lib/json/encoder.py in the source tree; I'm sure you could post on the tracker (hint) with a patch (hint hint) if you want it to strip spaces followed by newlines. ChrisA
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4