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

Test python-snappy with Python 3.8+

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Tests

      We currently do not test Python 3.8 with snappy:

        # Some tests fail with CPython 3.8 and python-snappy
         - platform: ubuntu-16.04
           python-version: ["3.8"]
           c-extensions: "*"
           compression: ["snappy"]
      

      Attempting to add python-snappy compression tests for python 3.8 and 3.9 fail with this error:

      [2020/09/10 21:48:29.864] ERROR [0.002s]: test_ensure_index_deprecation (test_legacy_api.TestDeprecations)
      [2020/09/10 21:48:29.864] ----------------------------------------------------------------------
      [2020/09/10 21:48:29.864] DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
      [2020/09/10 21:48:29.864] The above exception was the direct cause of the following exception:
      [2020/09/10 21:48:29.864] Traceback (most recent call last):
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/test/test_legacy_api.py", line 107, in test_ensure_index_deprecation
      [2020/09/10 21:48:29.864]     self.db.test.drop()
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/collection.py", line 1127, in drop
      [2020/09/10 21:48:29.864]     dbo.drop_collection(self.__name, session=session)
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/database.py", line 922, in drop_collection
      [2020/09/10 21:48:29.864]     return self._command(
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/database.py", line 626, in _command
      [2020/09/10 21:48:29.864]     return sock_info.command(
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/pool.py", line 699, in command
      [2020/09/10 21:48:29.864]     self._raise_connection_failure(error)
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/pool.py", line 683, in command
      [2020/09/10 21:48:29.864]     return command(self, dbname, spec, slave_ok,
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/network.py", line 120, in command
      [2020/09/10 21:48:29.864]     request_id, msg, size, max_doc_size = message._op_msg(
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/message.py", line 712, in _op_msg
      [2020/09/10 21:48:29.864]     return _op_msg_compressed(
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/message.py", line 678, in _op_msg_compressed
      [2020/09/10 21:48:29.864]     rid, msg = _compress(2013, msg, ctx)
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/message.py", line 500, in _compress
      [2020/09/10 21:48:29.864]     compressed = ctx.compress(data)
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/compression_support.py", line 112, in compress
      [2020/09/10 21:48:29.864]     return snappy.compress(data)
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/snappytest/lib/python3.9/site-packages/snappy.py", line 84, in compress
      [2020/09/10 21:48:29.864]     return _compress(data)
      [2020/09/10 21:48:29.864] SystemError: <built-in function compress> returned a result with an error set
      [2020/09/10 21:48:29.864] ======================================================================
      [2020/09/10 21:48:29.864] ERROR [0.002s]: test_geoHaystack_deprecation (test_legacy_api.TestDeprecations)
      [2020/09/10 21:48:29.864] ----------------------------------------------------------------------
      [2020/09/10 21:48:29.864] DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
      [2020/09/10 21:48:29.864] The above exception was the direct cause of the following exception:
      [2020/09/10 21:48:29.864] Traceback (most recent call last):
      [2020/09/10 21:48:29.864]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/collection.py", line 1127, in drop
      [2020/09/10 21:48:29.865]     dbo.drop_collection(self.__name, session=session)
      [2020/09/10 21:48:29.865]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/database.py", line 922, in drop_collection
      [2020/09/10 21:48:29.865]     return self._command(
      [2020/09/10 21:48:29.865]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/database.py", line 626, in _command
      [2020/09/10 21:48:29.865]     return sock_info.command(
      [2020/09/10 21:48:29.865]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/pool.py", line 699, in command
      [2020/09/10 21:48:29.865]     self._raise_connection_failure(error)
      [2020/09/10 21:48:29.865]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/pool.py", line 683, in command
      [2020/09/10 21:48:29.865]     return command(self, dbname, spec, slave_ok,
      [2020/09/10 21:48:29.865]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/network.py", line 120, in command
      [2020/09/10 21:48:29.865]     request_id, msg, size, max_doc_size = message._op_msg(
      [2020/09/10 21:48:29.865]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/message.py", line 712, in _op_msg
      [2020/09/10 21:48:29.865]     return _op_msg_compressed(
      [2020/09/10 21:48:29.865]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/message.py", line 678, in _op_msg_compressed
      [2020/09/10 21:48:29.865]     rid, msg = _compress(2013, msg, ctx)
      [2020/09/10 21:48:29.865]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/message.py", line 500, in _compress
      [2020/09/10 21:48:29.865]     compressed = ctx.compress(data)
      [2020/09/10 21:48:29.865]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/pymongo/compression_support.py", line 112, in compress
      [2020/09/10 21:48:29.865]     return snappy.compress(data)
      [2020/09/10 21:48:29.865]   File "/data/mci/ec48d7405b8e3978055809c82cac7b37/src/snappytest/lib/python3.9/site-packages/snappy.py", line 84, in compress
      [2020/09/10 21:48:29.865]     return _compress(data)
      [2020/09/10 21:48:29.865] SystemError: <built-in function compress> returned a result with an error set
      

      I've filed this issue upstream here: https://github.com/andrix/python-snappy/issues/97

      For now we could skip these two failing tests when snappy is enabled. Alternatively we could wait until python-snappy officially supports Python 3.8/3.9.

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

              Created:
              Updated: