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 terry.reedy
Recipients docs@python, ezio.melotti, rhettinger, terry.reedy, tomchristie
Date 2012-02-18.01:33:12
SpamBayes Score 6.811441e-06
Marked as misclassified No
Message-id <1329528794.54.0.924203513739.issue14042@psf.upfronthosting.co.za>
In-reply-to
Content
Entry for dump says
"If ensure_ascii is False (default: True), then some chunks written to fp may be unicode instances,"
Entry for dumps says
"If ensure_ascii is False, then the return value will be a unicode instance."
Entry for JSONEncoder says
"If ensure_ascii is True (the default), the output is guaranteed to be str objects with all incoming unicode characters escaped. If ensure_ascii is False, the output will be a unicode object."

I suspect the latter two meant to say something like
"If ensure_ascii is False and any chunk would be unicode, then the whole output is unicode."

And should 'all incoming unicode characters' either be or include 'all non-ascii chars (as in 3.x)?

---
In 3.x, ensure_ascii apparently has a different meaning.
"If ensure_ascii is True (the default), the output is guaranteed to have all incoming non-ASCII characters escaped. If ensure_ascii is False, these characters will be output as-is."

Unlike other params used in multiple json functions, ensure_ascii is only defined once, under json.JSONEncoder and not under dump and dumps. Should the JSONEncoder entry to copied to dump and dumps?
History
Date User Action Args
2012-02-18 01:33:14terry.reedysetrecipients: + terry.reedy, rhettinger, ezio.melotti, tomchristie, docs@python
2012-02-18 01:33:14terry.reedysetmessageid: <1329528794.54.0.924203513739.issue14042@psf.upfronthosting.co.za>
2012-02-18 01:33:13terry.reedylinkissue14042 messages
2012-02-18 01:33:12terry.reedycreate