This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author josh.r
Recipients josh.r, voxspox
Date 2016-12-16.00:43:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1481848993.02.0.345409199114.issue28984@psf.upfronthosting.co.za>
In-reply-to
Content
This is documented behavior for Python 2 ( https://docs.python.org/2/library/json.html#basic-usage ):

>Note: Since the default item separator is ', ', the output might include trailing whitespace when indent is specified. You can use separators=(',', ': ') to avoid this.

and also:

If specified, separators should be an (item_separator, key_separator) tuple. By default, (', ', ': ') are used. To get the most compact JSON representation, you should specify (',', ':') to eliminate whitespace.

Python 3 gives a different guarantee (dynamically chosen default separators based on the value of indent), and it follows that contract.

Given it's clearly documented, easily worked around, and largely harmless, I see no strong argument for backporting the Python 3 behavior to the legacy codebase.
History
Date User Action Args
2016-12-16 00:43:13josh.rsetrecipients: + josh.r, voxspox
2016-12-16 00:43:13josh.rsetmessageid: <1481848993.02.0.345409199114.issue28984@psf.upfronthosting.co.za>
2016-12-16 00:43:12josh.rlinkissue28984 messages
2016-12-16 00:43:12josh.rcreate