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

Add support for python 3.11 #125

Closed
qi55wyqu opened this issue Jun 24, 2023 · 3 comments
Closed

Add support for python 3.11 #125

qi55wyqu opened this issue Jun 24, 2023 · 3 comments

Comments

@qi55wyqu
Copy link

qi55wyqu commented Jun 24, 2023

Python 3.11 does not seem to be supported yet.

Python 3.10 shows a warning DeprecationWarning: 'U' mode is deprecated.

Running gherkin.parser.Parser().parse("test.feature") under Python 3.11 results in a ValueError

Output of pytest:

.../virtualenvs/.../lib/python3.11/site-packages/gherkin/parser.py:63: in parse
    token_scanner = TokenScanner(token_scanner_or_str) if isinstance(token_scanner_or_str, str) else token_scanner_or_str
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gherkin.token_scanner.TokenScanner object at 0x7fa4bccfbe90>
path_or_str = '.../unittests/test.feature'

    def __init__(self, path_or_str):
        if os.path.exists(path_or_str):
>           self.io = io.open(path_or_str, 'rU', encoding='utf8')
E           ValueError: invalid mode: 'rU'

Environment:

  • Python 3.11.4
  • gherkin-official 24.1.0
  • (pytest 7.4.0)

It would be great if you could add support for Python 3.11. Thank you very much.

@yurabysaha
Copy link

@mpkorstanje This is still a problem, also I can see pip pin to the old repo and it always gherkin-official 24.1.0 is it possible to fix it too?

@mpkorstanje
Copy link
Contributor

Cucumber is an opensource project, currently mostly run by mostly unpaid volunteers. We do not have a dedicated python maintainer and the other maintainers are somewhat lacking in either python knowledge, time and/or motivation to look at this.

If you or any one else would benefit from this and would be willing to do the work, please hop onto Slack, #commiters channel.

@kieran-ryan
Copy link
Sponsor Member

Issue was resolved prior to November 2022. See #3. Likely a result of using an older version of the parser in combination with the fact that I understand the Python distribution was not being published for a period. Upgrading should resolve the issue for you both @qi55wyqu and @yurabysaha.

self.io = io.open(path_or_str, 'r', encoding='utf8')

I can see pip pin to the old repo and it always gherkin-official 24.1.0 is it possible to fix it too?

@yurabysaha, this is now resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants