[New-bugs-announce] [issue9087] json docstrings on 3.x still use 'unicode' and 'str'

Ezio Melotti report at bugs.python.org
Sat Jun 26 20:04:33 CEST 2010

New submission from Ezio Melotti <ezio.melotti at gmail.com>:

In the json package there are still lot of docstrings that refer to 'unicode' and 'str' instead of 'str' and 'bytes' (AFAIU 'bytes' are not even allowed anymore in several places, so there should probably be only 'str' there).
A few examples:
* in json/__init__.py:
  If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``unicode``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``.
  If ``ensure_ascii`` is false, then the some chunks written to ``fp`` may be ``unicode`` instances, subject to normal Python ``str`` to ``unicode`` coercion rules.

* in json/decoder.py:
  Decode a JSON document from ``s`` (a ``str`` or ``unicode`` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended.

* in json/encoder.py:
  If ensure_ascii is true, the output is guaranteed to be str objects with all incoming unicode characters escaped.  If ensure_ascii is false, the output will be unicode object.

Note that the documentation (Doc/library/json.rst) seems already updated, so update the docstrings should be enough.

assignee: bob.ippolito
components: Documentation, Library (Lib)
messages: 108738
nosy: bob.ippolito, ezio.melotti
priority: normal
severity: normal
stage: needs patch
status: open
title: json docstrings on 3.x still use 'unicode' and 'str'
versions: Python 3.1, Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list