jsaddiction / TrailerTech

Download Trailers for you movies
MIT License
13 stars 4 forks source link

Python compatibility re underscore in numeric literals #25

Closed cgomesu closed 3 years ago

cgomesu commented 3 years ago

I've been testing on a couple of different machines and ran into a Python issue with underscore in numeric literals. More specifically:

Traceback (most recent call last):
  File "/opt/TrailerTech/TrailerTech.py", line 9, in <module>
    from media.movieFolder import MovieFolder
  File "/opt/TrailerTech/media/movieFolder.py", line 15
    MIN_TRAILER_SIZE = 500_000  # In bytes
                             ^
SyntaxError: invalid syntax

This machine was running Python 3.5.3 and I think Python has only started ignoring underscore in numeric literals after 3.6. Just a heads up to users running 3.5. Unfortunately, the latest version of Python3 in the apt repo for Debian 9 is that one (3.5.3-1 when this was posted).

Line 15 of the media/movieFolder.py file is the only one that has such issue though. So, my suggestion is to remove the underscore from MIN_TRAILER_SIZE because it won't affect users running the latest Python versions (3.6, 3.7, or 3.9).

jsaddiction commented 3 years ago

Many thanks to @cgomesu for spotting this issue. If you don't mind, please provide me with which versions of python you have tested with and I can add some compatibility Data to the wiki

cgomesu commented 3 years ago

OS:

Kernel:

Architecture:

Python3:

There's another machine that is not available right now that I've successfully used as well. It's arm64 architecture, running Armbian Buster and I think the Python3 version is 3.7 (it's the latest one you get via apt repo and I think they have the 3.7 there). I'll confirm once I get a hold of the machine again, so for now, I can only verify the info in the bullet points.

jsaddiction commented 3 years ago

Thanks a lot! I will do some further version testing. Once a minimum version is defined I will post it in the WIKI. I may make some more simple changes if it allows me to support a larger gamut.