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

Tests failing on Python 3.6 #498

Closed
jaraco opened this issue Mar 6, 2021 · 0 comments · Fixed by jrnl-org/jrnl#1213
Closed

Tests failing on Python 3.6 #498

jaraco opened this issue Mar 6, 2021 · 0 comments · Fixed by jrnl-org/jrnl#1213

Comments

@jaraco
Copy link
Owner

jaraco commented Mar 6, 2021

In 473465e, I updated the code to use a new interface for entry points. When I did, I tested in on Python 3.9. But when I pushed it for release, the tests were failing on Python 3.6 with:

>       for ep in metadata.entry_points(group='keyring.backends'):
E       TypeError: 'group' is an invalid keyword argument for this function

In this test, metadata.entry_points is monkey-patched to importlib_metadata.EntryPoints, a tuple subclass.

Investigating further, I learned that on Python 3.7+, tuple subclasses accept and ignore arbitrary keyword arguments, but on Python 3.6, those arguments are rejected.

$ python3.8 -c "type('Foo', (tuple,), {})(name='xyz')"
$ python3.9 -c "type('Foo', (tuple,), {})(name='xyz')"
$ python3.7 -c "type('Foo', (tuple,), {})(name='xyz')"
$ python3.6 -c "type('Foo', (tuple,), {})(name='xyz')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: 'name' is an invalid keyword argument for this function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant