Skip to content

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

Description

@robotcourses

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:

  • VS Code Version:1.91.0
  • OS: Windows
  • Python Version: 3.8.10
  • RobotFramework Version: 7.0.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions