jleclanche / python-bna

Python implementation of the mobile Blizzard Authenticator (TOTP)
https://eu.battle.net/support/en/article/24520
MIT License
250 stars 38 forks source link

SyntaxError: invalid syntax #19

Closed theAkito closed 5 years ago

theAkito commented 5 years ago
python3 bna
Traceback (most recent call last):
  File "/usr/local/bin/bna", line 4, in <module>
    __import__('pkg_resources').run_script('bna==4.1.0', 'bna')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 739, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1500, in run_script
    script_code = compile(script_text, script_filename, 'exec')
  File "/usr/local/lib/python3.5/dist-packages/bna-4.1.0-py3.5.egg/EGG-INFO/scripts/bna", line 66
    ctx.fail(f"No such authenticator: {serial}")
                                              ^
SyntaxError: invalid syntax

Why?

jleclanche commented 5 years ago

You need python 3.6+.

theAkito commented 5 years ago

You need python 3.6+.

Where does it say that in the README? It didn't even say what major Python version is needed...

jleclanche commented 5 years ago

Typically it's in the setup metadata:

https://github.com/jleclanche/python-bna/blob/172fe4733acdf92110b881a9882ec4c2b1ef808e/setup.cfg#L17-L20

I've added it to the Readme as well though now.

theAkito commented 5 years ago

Well, solved now, but I lost half an hour trying to figure out what is wrong. Thanks for the quick response, though.

theAkito commented 5 years ago

Typically it's in the setup metadata:

Well, I don't know much about Python, except that I have trouble with it 80% of the time using it because there is always some shit going on between Python2 and Python3..

jleclanche commented 5 years ago

Just make sure you're using 3.6 (or 3.7) and you'll be able to run most stuff nowadays. Unfortunately some distributions (Debian, most notably) still default on older stuff which is fairly ridiculous and causes issues for their users.