Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python >=3.12.4 is broken #666

Open
Mattwmaster58 opened this issue Oct 12, 2024 · 1 comment
Open

Python >=3.12.4 is broken #666

Mattwmaster58 opened this issue Oct 12, 2024 · 1 comment

Comments

@Mattwmaster58
Copy link

Describe the bug
There is a bug that gets triggered in Python 3.12.4 in pydantic: pydantic/pydantic#9637

This was fixed in version 2.8.2: pydantic/pydantic#9637 (comment)

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"
➜ 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 Mattwmaster58 changed the title Python 3.12.4 is broken Python >=3.12.4 is broken Oct 12, 2024
@Mattwmaster58
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant