tree-sitter-grammars / tree-sitter-requirements

pip requirements grammar for tree-sitter
MIT License
5 stars 0 forks source link

bug: path is not string or int #3

Closed Freed-Wu closed 7 months ago

Freed-Wu commented 7 months ago

Did you check existing issues?

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

       >   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
       >   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
       >   File "/nix/store/xkmxbvf5d2g8mghv4369sbprkhd4g0rn-python3.11-tree-sitter-requirements-v0.3.3/lib/python3.11/site-packages/tree_sitter_requirements/__init__.py", line 3, in <module>
       >     from ._core import parse, query, highlights
       >   File "/nix/store/xkmxbvf5d2g8mghv4369sbprkhd4g0rn-python3.11-tree-sitter-requirements-v0.3.3/lib/python3.11/site-packages/tree_sitter_requirements/_core.py", line 13, in <module>
       >     _language = Language(
       >                 ^^^^^^^^^
       >   File "/nix/store/qm8xwarqmpv9qwjswrgkx3iwqycqsafb-python3.11-tree-sitter-0.21.1/lib/python3.11/site-packages/tree_sitter/__init__.py", line 140, in __init__
       >     raise TypeError("Expected a string or int for the first argument")
       > TypeError: Expected a string or int for the first argument

Steps To Reproduce/Bad Parse Tree

Need to add a str() for PurePath().

Expected Behavior/Parse Tree

str or int

Repro

No response

ObserverOfTime commented 7 months ago

Fixed in https://github.com/tree-sitter/py-tree-sitter/commit/5d52aceab4b4da20a12b610c0cb810fef36d844c (v0.21.3)