nabla-c0d3 / sslyze

Fast and powerful SSL/TLS scanning library.
GNU Affero General Public License v3.0
3.28k stars 454 forks source link

Python >=3.12.4 is broken #666

Open Mattwmaster58 opened 1 month ago

Mattwmaster58 commented 1 month ago

Describe the bug There is a bug that gets triggered in Python 3.12.4 in pydantic: https://github.com/pydantic/pydantic/issues/9637

This was fixed in version 2.8.2: https://github.com/pydantic/pydantic/issues/9637#issuecomment-2263799806

To Reproduce

  1. in Python >=3.12.4 install sslyze, and a library that exhibits this issue: `pip install sslyze spacy
  2. python -c "import spacy"
  3. ➜ python -c "import spacy"   
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/venv/lib/python3.12/site-packages/spacy/__init__.py", line 13, in <module>
    from . import pipeline  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^
    File "/venv/lib/python3.12/site-packages/spacy/pipeline/__init__.py", line 1, in <module>
    from .attributeruler import AttributeRuler
    File "/venv/lib/python3.12/site-packages/spacy/pipeline/attributeruler.py", line 8, in <module>
    from ..language import Language
    File "/venv/lib/python3.12/site-packages/spacy/language.py", line 46, in <module>
    from .pipe_analysis import analyze_pipes, print_pipe_analysis, validate_attrs
    File "/venv/lib/python3.12/site-packages/spacy/pipe_analysis.py", line 6, in <module>
    from .tokens import Doc, Span, Token
    File "/venv/lib/python3.12/site-packages/spacy/tokens/__init__.py", line 1, in <module>
    from ._serialize import DocBin
    File "/venv/lib/python3.12/site-packages/spacy/tokens/_serialize.py", line 14, in <module>
    from ..vocab import Vocab
    File "spacy/vocab.pyx", line 1, in init spacy.vocab
    File "spacy/tokens/doc.pyx", line 49, in init spacy.tokens.doc
    File "/venv/lib/python3.12/site-packages/spacy/schemas.py", line 195, in <module>
    class TokenPatternString(BaseModel):
    File "/venv/lib/python3.12/site-packages/pydantic/v1/main.py", line 286, in __new__
    cls.__try_update_forward_refs__()
    File "/venv/lib/python3.12/site-packages/pydantic/v1/main.py", line 807, in __try_update_forward_refs__
    update_model_forward_refs(cls, cls.__fields__.values(), cls.__config__.json_encoders, localns, (NameError,))
    File "/venv/lib/python3.12/site-packages/pydantic/v1/typing.py", line 554, in update_model_forward_refs
    update_field_forward_refs(f, globalns=globalns, localns=localns)
    File "/venv/lib/python3.12/site-packages/pydantic/v1/typing.py", line 529, in update_field_forward_refs
    update_field_forward_refs(sub_f, globalns=globalns, localns=localns)
    File "/venv/lib/python3.12/site-packages/pydantic/v1/typing.py", line 520, in update_field_forward_refs
    field.type_ = evaluate_forwardref(field.type_, globalns, localns or None)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/venv/lib/python3.12/site-packages/pydantic/v1/typing.py", line 66, in evaluate_forwardref
    return cast(Any, type_)._evaluate(globalns, localns, set())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

Because of sslyze's dependancy requirements, it is impossible to have the version of pydantic with the fix for this installed.

Mattwmaster58 commented 1 month ago

issue with different problem that has the same resolution as this issue: #652