iamleot / transferwee

Download/upload files via wetransfer.com
155 stars 38 forks source link

Not compatible with 3.8 #49

Closed gemp closed 11 months ago

gemp commented 1 year ago

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 commented 1 year ago

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.

gemp commented 1 year ago

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 commented 1 year ago

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.