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

GridOut does not implement seekable() from io.IOBase

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 3.7.2
    • Fix Version/s: 3.8
    • Component/s: GridFS
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible

      Description

      PR: https://github.com/mongodb/mongo-python-driver/pull/387

       

      Description from GitHub PR:

      I'm testing out moving our system to using Python3.7. We have an instance where we are using [ZipFile](https://docs.python.org/3/library/zipfile.html#zipfile.ZipFile) on a `GridOut` instance. Because [seekable()](https://www.python.org/dev/peps/pep-3116/#raw-i-o) is defined as part of the IO API the ZipFile implementation does not handle an `AttributeError` coming from accessing the `seekable` method.

      This appears to be a change in the `ZipFile` implementation between Python3.6 and Python3.7.

      The `GridOut` implementation is relatively close to implementing `io.IOBase` so I figured I would close the gap, have it subclass `io.IOBase` and also note where it diverges from the `io.IOBase` behavior.

      I don't use `ZipFile` against a `GridIn` instance and it diverges from `io.IOBase` in that it doesn't return the number of bytes written so I refrained from making it a subclass of `io.IOBase`

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shane.harvey Shane Harvey
              Reporter:
              terencehonles Terence Honles
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: