robotcodedev / robotframework-gherkin-parser

RobotFramework GherkinParser
Apache License 2.0
20 stars 3 forks source link

[BUG] TypeError: 'ABCMeta' object is not subscriptable #6

Open robotcourses opened 4 months ago

robotcourses commented 4 months ago

Describe the bug When trying to parse the ".feature" file using GherkinParse, I receive the error in the console.

[ ERROR ] Importing parser 'GherkinParser' failed: TypeError: 'ABCMeta' object is not subscriptable

I'm using Poetry to create the virtual environment and using the Robot Framework Language Server as a VSCode plugin

Below, my "pyproject.toml" file

[tool.poetry]
name = "gherkin-parse2"
version = "0.1.0"
description = ""
authors = ["Robot Courses <git@robotcourses.com.br>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.8"
robotframework = "^7.0.1"
robotframework-gherkin-parser = "^0.3.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

To Reproduce I created a file "calculator.feature" and ran it using "--parse" GherkinParse. My expectation was that the execution would fail due to the lack of keywords, just as it failed at RoboCon24.

Logs

[ ERROR ] Importing parser 'GherkinParser' failed: TypeError: 'ABCMeta' object is not subscriptable
Traceback (most recent call last):
  File "C:\Users\robotcourses\AppData\Local\pypoetry\Cache\virtualenvs\gherkin-parse-HEaL1qac-py3.8\lib\site-packages\GherkinParser\__init__.py", line 1, in <module>
    from .gherkin_parser import GherkinParser
  File "C:\Users\robotcourses\AppData\Local\pypoetry\Cache\virtualenvs\gherkin-parse-HEaL1qac-py3.8\lib\site-packages\GherkinParser\gherkin_parser.py", line 9, in <module>
    from .gherkin_builder import build_gherkin_model
  File "C:\Users\robotcourses\AppData\Local\pypoetry\Cache\virtualenvs\gherkin-parse-HEaL1qac-py3.8\lib\site-packages\GherkinParser\gherkin_builder.py", line 9, in <module>
    from gurke.parser import Parser
  File "C:\Users\robotcourses\AppData\Local\pypoetry\Cache\virtualenvs\gherkin-parse-HEaL1qac-py3.8\lib\site-packages\gurke\parser.py", line 9, in <module>
    from .token_scanner import TokenScanner
  File "C:\Users\robotcourses\AppData\Local\pypoetry\Cache\virtualenvs\gherkin-parse-HEaL1qac-py3.8\lib\site-packages\gurke\token_scanner.py", line 10, in <module>
    class TokenScanner(object):
  File "C:\Users\robotcourses\AppData\Local\pypoetry\Cache\virtualenvs\gherkin-parse-HEaL1qac-py3.8\lib\site-packages\gurke\token_scanner.py", line 11, in TokenScanner
    def __init__(self, path_or_str: Union[os.PathLike[str], str]) -> None:
PYTHONPATH:
  C:\Users\robotcourses\AppData\Local\pypoetry\Cache\virtualenvs\gherkin-parse-HEaL1qac-py3.8\Scripts\robot.exe       
  C:\Users\robotcourses\AppData\Local\Programs\Python\Python38\python38.zip
  C:\Users\robotcourses\AppData\Local\Programs\Python\Python38\DLLs
  C:\Users\robotcourses\AppData\Local\Programs\Python\Python38\lib
  C:\Users\robotcourses\AppData\Local\Programs\Python\Python38
  C:\Users\robotcourses\AppData\Local\pypoetry\Cache\virtualenvs\gherkin-parse-HEaL1qac-py3.8
  C:\Users\robotcourses\AppData\Local\pypoetry\Cache\virtualenvs\gherkin-parse-HEaL1qac-py3.8\lib\site-packages 

Desktop:

psa-jbeaumont commented 1 month ago

Reproduced with python 3.8.9, Not reproduced with python 3.11.8