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

Python 3.5.3 compatibility #17

Closed
N-Coder opened this issue May 4, 2019 · 5 comments
Closed

Python 3.5.3 compatibility #17

N-Coder opened this issue May 4, 2019 · 5 comments

Comments

@N-Coder
Copy link
Owner

N-Coder commented May 4, 2019

  File "/home/finksim/src/studip-fuse/studip_fuse/studipfs/api/aiointerface.py", line 4, in <module>
    from typing import Any, AsyncContextManager, AsyncGenerator, Callable, Coroutine, Dict, Generic, NamedTuple, Optional, TypeVar, Union
ImportError: cannot import name 'AsyncContextManager'

  File "/home/finksim/src/studip-fuse/studip_fuse/studipfs/api/aiointerface.py", line 4, in <module>
    from typing import Any, AsyncGenerator, Callable, Coroutine, Dict, Generic, NamedTuple, Optional, TypeVar, Union
ImportError: cannot import name 'AsyncGenerator'

  File "/home/finksim/src/studip-fuse/studip_fuse/launcher/aioimpl/asyncio/aiohttp_client.py", line 115, in DownloadState
    EMPTY = enum.auto()
AttributeError: module 'enum' has no attribute 'auto'

  File "/home/finksim/src/studip-fuse/studip_fuse/studipfs/api/session.py", line 6, in <module>
    from typing import AsyncGenerator, List, Mapping, Tuple
ImportError: cannot import name 'AsyncGenerator'

typing.AsyncGenerator is new in version 3.5.4
typing.AsyncContextManager is new in version 3.6
enum.auto is new in version 3.6

@N-Coder
Copy link
Owner Author

N-Coder commented May 4, 2019

should also check whether we could use an old aiohttp version under Ubuntu 16.04

@N-Coder
Copy link
Owner Author

N-Coder commented May 5, 2019

typing.AsyncContextManager is backported by typing_extensions, typing.AsyncGenerator is only exported by typing_extensions if related classes are also available, which is not the case on 3.5.3. It is available trough trio-typing (which also requires trio and mypy).

enum.auto() can be simulated by using the functional API, using the aenum package or simply defining the int values explicitly.

@ClusterJan
Copy link

Testing the new "Python3.5" branch results in a new error:

Uncaught exception from FUSE operation readdir, returning errno.EINVAL: argument of type 'NotImplementedType' is not iterable
Traceback (most recent call last):
[...]
  File "/home/aschwege/.local/lib/python3.5/site-packages/cached_property.py", line 35, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/home/aschwege/.local/lib/python3.5/site-packages/studip_fuse/avfs/virtual_path.py", line 231, in content_options
    if field_name not in self.format_token_generators:
TypeError: argument of type 'NotImplementedType' is not iterable

@N-Coder
Copy link
Owner Author

N-Coder commented May 6, 2019

__init_subclass__ used in virtual_path.py:215 to initialize the format_token_generators was added in 3.6

@N-Coder
Copy link
Owner Author

N-Coder commented May 10, 2019

should be fixed by d644f57 and 8558a4f

@N-Coder N-Coder closed this as completed May 10, 2019
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

2 participants