Headphones - Music albums & artists auto download program

  Thread Rating:
  • 7 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Ferdi-T Offline
Senior Member
Posts: 194
Joined: Jul 2011
Reputation: 1
Post: #1426
Got the following problem. Installed Headphones on my NAS running Python 2.5, got an error:

Code:
/opt/share/headphones/Headphones.py:103: Warning: 'with' will become a reserved keyword in Python 2.6
  File "/opt/share/headphones/Headphones.py", line 103
    with open(headphones.PIDFILE, 'w') as fp:
            ^
SyntaxError: invalid syntax

Solved the error by adding 'from __future__ import with_statement' to Headphones.py. Now I get:

Code:
File "/opt/share/headphones/Headphones.py", line 105
    except IOError as e:
                    ^
SyntaxError: invalid syntax

Line 105 in bold:

Code:
# The pidfile is only useful in daemon mode, make sure we can write the file properly
        if headphones.DAEMON:
            headphones.CREATEPID = True

            try:
                with open(headphones.PIDFILE, 'w') as fp:
                    fp.write("pid\n")
            [b]except IOError as e:[[/b]
                raise SystemExit("Unable to write PID file: %s [%d]", e.strerror, e.errno)
        else:
            logger.warn("Not running in daemon mode. PID file creation disabled.")

Now the Obvious solution would be to upgrade to python 2.6, but my NAS is extremely picky about installing it. So does anyone know how to get HP running with python 2.5?
(This post was last modified: 2014-10-10 11:50 by Ferdi-T.)
find quote
Ferdi-T Offline
Senior Member
Posts: 194
Joined: Jul 2011
Reputation: 1
Post: #1427
Or perhaps I can use one of the older versions of Headphones?
find quote
Post Reply