matteomattei / PySquashfsImage

Python library to read Squashfs image files.
GNU General Public License v3.0
50 stars 20 forks source link

ImportError: cannot import name 'ByteString' from 'typing' with Python 3.14 #28

Closed mxmlnkn closed 2 weeks ago

mxmlnkn commented 2 weeks ago

Python 3.14 has removed typing / will remove typing.ByteString. This leads to this error in my CI for 3.14.0-alpha.0:

/opt/hostedtoolcache/Python/3.14.0-alpha.0/x64/lib/python3.14/site-packages/PySquashfsImage/compressor.py:62: in __init__
    import zstandard
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    # Copyright (c) 2017-present, Gregory Szorc
    # All rights reserved.
    #
    # This software may be modified and distributed under the terms
    # of the BSD license. See the LICENSE file for details.

    """Python interface to the Zstandard (zstd) compression library."""

    from __future__ import absolute_import, unicode_literals

    # This module serves 2 roles:
    #
    # 1) Export the C or CFFI "backend" through a central module.
    # 2) Implement additional functionality built on top of C or CFFI backend.

    import builtins
    import io
    import os
    import platform

>   from typing import ByteString
E   ImportError: cannot import name 'ByteString' from 'typing' 
mxmlnkn commented 2 weeks ago

My bad. I tried to find the code location but the log confused me and I completely forgot that I encountered this issue in another place 3 weeks ago: https://github.com/indygreg/python-zstandard/issues/238 This issue happens during the import zstandard line. So it is not an issue with this library directly.