classification
Title: json docstrings on 3.x still use 'unicode' and 'str'
Type: Stage: needs patch
Components: Documentation, Library (Lib) Versions: Python 3.1, Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: bob.ippolito Nosy List: bob.ippolito, ezio.melotti, georg.brandl
Priority: normal Keywords:

Created on 2010-06-26 18:04 by ezio.melotti, last changed 2010-08-02 20:16 by georg.brandl. This issue is now closed.

Messages (2)
msg108738 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-06-26 18:04
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.
msg112532 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-08-02 20:16
Fixed in r83560.
History
Date User Action Args
2010-08-02 20:16:23georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg112532

resolution: fixed
2010-06-26 18:04:31ezio.melotticreate