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

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

Open
robotcourses opened this issue Jul 10, 2024 · 1 comment
Open

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

robotcourses opened this issue Jul 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@robotcourses
Copy link

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 <[email protected]>"]
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
@robotcourses robotcourses added the bug Something isn't working label Jul 10, 2024
@psa-jbeaumont
Copy link

Reproduced with python 3.8.9, Not reproduced with python 3.11.8

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

2 participants