This fixes warnings from the C Python library at run time on newer versions of Python 3, e.g. during the test suite:
tests/test_bencode.py: 28 warnings
/home/jelmer/src/better-bencode/tests/test_bencode.py:78: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
assert module.loads(binary) == struct
tests/test_bencode.py: 28 warnings
/home/jelmer/src/better-bencode/tests/test_bencode.py:89: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
assert module.dumps(struct) == binary
tests/test_bencode.py: 56 warnings
/home/jelmer/src/better-bencode/tests/test_bencode.py:95: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
module.dump(struct, fp)
tests/test_bencode.py: 46 warnings
/home/jelmer/src/better-bencode/tests/test_bencode.py:224: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
module.loads(binary)
tests/test_bencode.py: 12 warnings
/home/jelmer/src/better-bencode/tests/test_bencode.py:284: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
dumped = module.dumps(indata, cast=True)
tests/test_bencode.py: 12 warnings
/home/jelmer/src/better-bencode/tests/test_bencode.py:286: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
Use Py_ssize_t rather than int for sizes.
This fixes warnings from the C Python library at run time on newer versions of Python 3, e.g. during the test suite:
tests/test_bencode.py: 28 warnings /home/jelmer/src/better-bencode/tests/test_bencode.py:78: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats assert module.loads(binary) == struct
tests/test_bencode.py: 28 warnings /home/jelmer/src/better-bencode/tests/test_bencode.py:89: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats assert module.dumps(struct) == binary
tests/test_bencode.py: 56 warnings /home/jelmer/src/better-bencode/tests/test_bencode.py:95: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats module.dump(struct, fp)
tests/test_bencode.py: 46 warnings /home/jelmer/src/better-bencode/tests/test_bencode.py:224: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats module.loads(binary)
tests/test_bencode.py: 12 warnings /home/jelmer/src/better-bencode/tests/test_bencode.py:284: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats dumped = module.dumps(indata, cast=True)
tests/test_bencode.py: 12 warnings /home/jelmer/src/better-bencode/tests/test_bencode.py:286: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats