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

Crash during sourcery review ./ --fix #430

Closed
tylerlaprade opened this issue Jul 3, 2024 · 4 comments
Closed

Crash during sourcery review ./ --fix #430

tylerlaprade opened this issue Jul 3, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@tylerlaprade
Copy link

Traceback (most recent call last):
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/__main__.py", line 671, in <module>
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/click/core.py", line 1157, in __call__
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/click/core.py", line 1078, in main
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/click/core.py", line 1688, in invoke
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/click/core.py", line 1434, in invoke
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/click/core.py", line 783, in invoke
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/__main__.py", line 385, in review
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/binary/command_line_interface/__init__.py", line 394, in review
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/binary/command_line_interface/__init__.py", line 564, in _review
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/hypergraph.py", line 48, in query_text_documents
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/fix.py", line 44, in query_tree
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/skip_comments.py", line 169, in query_tree
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/rule.py", line 160, in query_tree
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/rule.py", line 111, in query_tree
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/rule.py", line 127, in query_node
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/rule.py", line 51, in query_node
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/matchers/replacement.py", line 30, in query_node
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/matchers/pattern.py", line 145, in query_node
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/matchers/pattern.py", line 185, in passes_condition
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/conditions/condition_ast.py", line 55, in evaluate
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/conditions/python/type_conditions.py", line 38, in has_type
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/analysis/python_analysis.py", line 219, in node_type
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/analysis/python_analysis.py", line 205, in node_types
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/analysis/python_analysis.py", line 186, in document_types
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/languages/python_types.py", line 100, in calculate_document_types
  File "/Users/tyler/Code/condor/.env/lib/python3.12/site-packages/sourcery/hypergraph/languages/python_types.py", line 246, in _infer_expression_type
ValueError: too many values to unpack (expected 2)
@tylerlaprade tylerlaprade added the bug Something isn't working label Jul 3, 2024
@ruancomelli ruancomelli self-assigned this Jul 3, 2024
@ruancomelli
Copy link
Contributor

Hey, @tylerlaprade! Thanks for opening this bug report.

Do you have a code snippet that reproduces this issue?

@tylerlaprade
Copy link
Author

I can consistently repro when running it on my entire codebase. I don't know which file is the culprit, though. It still happens now after various other changes in the code from the past couple weeks, including fixing the previously revealed Sourcery errors.

@tylerlaprade
Copy link
Author

Not sure if related, two of the autofixes introduce typechecking errors in my code. At least today, those are the last two files successfully checked.

@brendanator
Copy link
Collaborator

Hi @tylerlaprade. thanks for reporting this

I've found a fix which will be in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants