henkelis / sonospy

Sonospy is a UPnP control point and Windows Media proxy for the Sonos multi-room audio system.
GNU General Public License v3.0
113 stars 16 forks source link

Starting pycpoint with a music db that doesn't exist causes pycpoint to consumes 100% of the CPU #61

Open michaelnt opened 13 years ago

michaelnt commented 13 years ago

This change causes errors during the creation of the Proxy class to cause pycpoint to quit.

This branch also includes a commit which is in a separate pull request, so I can rebase it if required.

michaelnt commented 13 years ago

I rebased this against the HEAD of unstable which seems to have removed the comments from the pull request, so pasting them back in

On 5 September 2011 22:39, henkelis reply+c-570689-181fe2eb81671bf20e812db2f2f253d3c6f2146a@reply.github.com wrote:

Michael, this is probably my misunderstanding of Python, but what catches the ProxyError in pycpoint.py?

Nothing is catching the error, the python interpreter will print out the error message and then quit. To me it seems like an un-recoverable error so you should just quit. At the moment it continues to run but consumes 100% of the cpu.

Also, mutagen and dateutil are packages too (you've probably already guessed that I've updated all of them).

I'll check those as well.

michaelnt commented 13 years ago

Sorry, yes I agree it should quit - as long as that isn't with a stack trace that's fine (i.e. you just get a simple message).

Actually you do get a stack trace. I think it is best to trap the known error in the option handling and leave the other un-expected errors to produce a stack trace, that might prove useful in debugging.

I can tack on the option parsing improvements to this pull request if you want.

(py26)michaelt@esos:/data/Work/sonospy$ cat pycpoint.log Args: option.proxyonly: True WMP proxy: Sonospy=Henkelis,Sonospyasdf.db Proxy. Name: Henkelis Traceback (most recent call last): File "pycpoint.py", line 6252, in main() File "pycpoint.py", line 6239, in main web = ControlPointWeb() File "pycpoint.py", line 675, in init wmpcontroller=wmpcontroller, wmpcontroller2=wmpcontroller2) File "/data/Work/sonospy/src/sonospy/proxy.py", line 147, in init raise ProxyError("Unable to access database file") proxy.ProxyError: Unable to access database file

michaelnt commented 13 years ago

I've removed the traceback if PRoxyErrors are raised by trapping and exiting.

I've removed dateutil as it's unmodified it should get pulled in by running python setup.py develop.

I added pristine versions of mutagen and cherrypy so that Mark's edits could be seen in the history.

michaelnt commented 13 years ago

I'd suggest merging this pull request, creating a branch (and pushing to github) that points to that commit and then adding a commit which removes the un-needed stuff.

In this way you have a branch that contains the scripts if needed, and the scripts will run as they have all their dependencies.

the web.py script for instance failed to import from cherrypy because of some missing parts of cherrypy.