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

Not compatible with 3.8 #49

Closed
gemp opened this issue May 22, 2023 · 3 comments · Fixed by #78
Closed

Not compatible with 3.8 #49

gemp opened this issue May 22, 2023 · 3 comments · Fixed by #78
Assignees

Comments

@gemp
Copy link

gemp commented May 22, 2023

Hello,

It's apparently not compatible with versions < 3.9 anymore, contrary to what is assumed in 4f7cd22. Here's the error in 3.8:

Traceback (most recent call last):
  File "./transferwee.py", line 175, in <module>
    def _file_name_and_size(file: str) -> dict[str, Union[int, str]]:
TypeError: 'type' object is not subscriptable

I'm not qualified in Python to understand exactly what's going on here, as long as the import seems to be present at the top: from typing import Any, List, Optional, Union.

@iamleot
Copy link
Owner

iamleot commented May 22, 2023

Thanks!

Probably some kind of type annotation only supported in newer Python-s... I will try to investigate that!

(It's tested against Python 3.10 and it should works there! (if it's not too difficult to update as a quick workaround I suggest to do that!))

I hope to investigate that better.

@iamleot iamleot self-assigned this May 22, 2023
@gemp
Copy link
Author

gemp commented May 22, 2023

Thanks for your amazingly quick answer!

I tested it with 3.9 and it works flawlessly.

Unfortunately, I cannot update for the moment the production server it's supposed to run on, way too touchy.
So if there's a quick fix it would be insanely great.

@gemp
Copy link
Author

gemp commented May 22, 2023

I investigated a bit further and, not being a Python developer, that was tricky 😅

But I managed to make it work by adding an import from typing import Dict, etc..

And replacing all dict with Dict.

I cannot make a pull request with that simple solution, not tested with 3.9 or 3.10 but it woks for 3.8.

And f'n thanks for that really good script. It rocks.

sharevb added a commit to sharevb/transferwee that referenced this issue Oct 25, 2023
iamleot added a commit that referenced this issue Dec 3, 2023
Add a matrix in order to check at least:

- oldest Python version
- default Python version on pkgsrc-current
- newest Python version

Related to #49 and #71.
iamleot added a commit that referenced this issue Dec 3, 2023
Add a matrix in order to check at least:

- oldest Python version
- default Python version on pkgsrc-current
- newest Python version

Set `fail-fast` to `false` (by default it is `true`) in order to run
all matrix jobs to see all Python versions that fail instead of
pointing out only the first (and non-deterministic) one that fails.

Related to #49 and #71.
iamleot added a commit that referenced this issue Dec 3, 2023
Add a matrix in order to check at least:

- oldest Python version
- default Python version on pkgsrc-current
- newest Python version available

Set `fail-fast` to `false` (by default it is `true`) in order to run
all matrix jobs to see all Python versions that fail instead of
pointing out only the first (and non-deterministic) one that fails.

Related to #49 and #71.
iamleot added a commit that referenced this issue Dec 3, 2023
Add a matrix in order to check at least:

- oldest Python version
- default Python version on pkgsrc-current
- newest Python version

Set `fail-fast` to `false` (by default it is `true`) in order to run
all matrix jobs to see all Python versions that fail instead of
pointing out only the first (and non-deterministic) one that fails.

Related to #49 and #71.
iamleot added a commit that referenced this issue Dec 3, 2023
Python 3.8 annotations needs Dict from typing.Dict (i.e. direct `dict`
is not usable).

Switch to use it in order to be usable from all Python versions.

Related/closes #49 and #71.
iamleot added a commit that referenced this issue Dec 3, 2023
Add a matrix in order to check at least:

- oldest Python version
- default Python version on pkgsrc-current
- newest Python version

Set `fail-fast` to `false` (by default it is `true`) in order to run
all matrix jobs to see all Python versions that fail instead of
pointing out only the first (and non-deterministic) one that fails.

Related to #49 and #71.
iamleot added a commit that referenced this issue Dec 3, 2023
Python 3.8 annotations needs Dict from typing.Dict (i.e. direct `dict`
is not usable).

Switch to use it in order to be usable from all Python versions.

Related/closes #49 and #71.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants