| 207 | |
| 208 | |
| 209 | def is_supported_msgpack(): |
| 210 | # DO NOT CHANGE OR REMOVE! See also requirements and comments in pyproject.toml. |
| 211 | # This function now also respects the env var BORG_MSGPACK_VERSION_CHECK. |
| 212 | # Set BORG_MSGPACK_VERSION_CHECK=no to disable the version check at your own risk. |
| 213 | import msgpack |
| 214 | |
| 215 | version_check = os.environ.get("BORG_MSGPACK_VERSION_CHECK", "yes").strip().lower() |
| 216 | if version_check == "no": |
| 217 | return True |
| 218 | |
| 219 | if msgpack.version in []: # < add bad releases here to deny list |
| 220 | return False |
| 221 | return (1, 0, 3) <= msgpack.version[:3] <= (1, 1, 2) |
| 222 | |
| 223 | |
| 224 | def get_limited_unpacker(kind): |