Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-3511

Remove Python 2 references from the docs

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.5
    • Affects Version/s: None
    • Component/s: None

      GridFS.read says:

      The bytes are returned as an instance of :class:`str` (:class:`bytes` in python 3).

      We don't support python 2 anymore so these docs should only describe the Python 3 behavior.

      This problem is widespread across the docs:

      $ git grep 'in python 3'
      bson/__init__.py:669:    # Keys can only be text in python 3.
      bson/__init__.py:1004:    :class:`basestring` (:class:`str` in python 3). Raises
      bson/__init__.py:1301:    :class:`str` (:class:`bytes` in python 3). Returns ``True``
      bson/__init__.py:1338:        :class:`basestring` (:class:`str` in python 3). Raises
      bson/_cbsonmodule.c:3010:    /* PyCapsule is new in python 3.1 */
      bson/code.py:26:    :class:`basestring` (:class:`str` in python 3) or `scope`
      bson/dbref.py:44:        an instance of :class:`basestring` (:class:`str` in python 3).
      bson/objectid.py:188:        in python 3), ObjectId) and InvalidId if it is not a
      doc/changelog.rst:2018:trivial wrapper around long (in python 2.x) or int (in python 3.x). This
      gridfs/grid_file.py:596:        in python 3). If `size` is negative or omitted all data is read.
      pymongo/collection.py:124:        :class:`basestring` (:class:`str` in python 3). Raises
      pymongo/collection.py:1946:        (:class:`str` in python 3), and the direction(s) must be one of
      pymongo/collection.py:2639:        (:class:`str` in python 3). Raises :class:`~pymongo.errors.InvalidName`
      pymongo/collection.py:2703:        :class:`basestring` (:class:`str` in python 3).
      pymongo/cursor.py:882:        :class:`basestring` (:class:`str` in python 3).
      pymongo/cursor.py:980:        (:class:`str` in python 3) or :class:`~bson.code.Code`
      pymongo/cursor.py:992:        :class:`basestring` (:class:`str` in python 3). Raises
      pymongo/database.py:83:        :class:`basestring` (:class:`str` in python 3). Raises
      pymongo/database.py:718:        (:class:`str` in python 3) then the command {`command`: `value`}
      pymongo/mongo_client.py:1879:        :class:`basestring` (:class:`str` in python 3) or
      pymongo/operations.py:439:        (:class:`str` in python 3), and the direction(s) must be one of
      test/test_bson.py:533:        # as keys in python 3.x. Using binary data as a key makes
      

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: