hechtus / mopidy-radio-de

radio.de Extension for Mopidy
Apache License 2.0
11 stars 9 forks source link

Mopidy crashes when no proxy is specified #7

Closed pmildner closed 10 years ago

pmildner commented 10 years ago

I just tried out the extension (I installed in using pip install ...) with mopidy 0.18.3. After specifying the configuration values (language, favorites), mopidy crashed on startup. Below you can see the error message. As I did not specify a proxy in my mopidy configuration, I just commented out lines 57-60 in api.py. After doing so, both mopidy and the extension worked again.

ERROR    object of type 'NoneType' has no len()
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/mopidy/__main__.py", line 128, in main
    return args.command.run(args, proxied_config)
  File "/usr/local/lib/python2.7/dist-packages/mopidy/commands.py", line 268, in run
    backends = self.start_backends(config, backend_classes, audio)
  File "/usr/local/lib/python2.7/dist-packages/mopidy/commands.py", line 294, in start_backends
    backend = backend_class.start(config=config, audio=audio).proxy()
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 93, in start
    obj = cls(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mopidy_radio_de/actor.py", line 48, in __init__
    proxy=proxy)
  File "/usr/local/lib/python2.7/dist-packages/mopidy_radio_de/api.py", line 57, in __init__
    if len(proxy):
TypeError: object of type 'NoneType' has no len()
Traceback (most recent call last):
  File "/usr/local/bin/mopidy", line 9, in <module>
    load_entry_point('Mopidy==0.18.3', 'console_scripts', 'mopidy')()
  File "/usr/local/lib/python2.7/dist-packages/mopidy/__main__.py", line 128, in main
    return args.command.run(args, proxied_config)
  File "/usr/local/lib/python2.7/dist-packages/mopidy/commands.py", line 268, in run
    backends = self.start_backends(config, backend_classes, audio)
  File "/usr/local/lib/python2.7/dist-packages/mopidy/commands.py", line 294, in start_backends
    backend = backend_class.start(config=config, audio=audio).proxy()
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 93, in start
    obj = cls(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mopidy_radio_de/actor.py", line 48, in __init__
    proxy=proxy)
  File "/usr/local/lib/python2.7/dist-packages/mopidy_radio_de/api.py", line 57, in __init__
    if len(proxy):
TypeError: object of type 'NoneType' has no len()
hechtus commented 10 years ago

@AlexandrePTJ Could you please have a look?

hechtus commented 10 years ago

Could you please check if it's working for you now?

pmildner commented 10 years ago

That works. Thank you for the quick response!

zaphod-muc commented 10 years ago

Hello, I have found the same behaviour. Have installed mopidy 0.18.3, then pip install modidy-radio-de (as root, if that matters). It looks like I have installed 0.20 of the plugin, but same behaviour - as soon as I insert the radio-de section in the config, mopidy crashes at startup. I have commented out lines 57-60 in api.py (four lines treating with proxy settings, as far as I could see), now mopidy does not crash but I do not find radio.de entries in my database either (I expected to find an additional offering in the database section, like I did after activiation of the TuneIn plugin)

Ehm, after that I also tried pip install mopidy-radio-de --upgrade and got

[snip] Downloading/unpacking setuptools>=0.7 (from distribute->mopidy-radio-de) Exception in thread Thread-6: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 551, in bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 504, in run self.__target(_self.args, *_self.__kwargs) File "/usr/lib/python2.7/dist-packages/pip/index.py", line 243, in _get_queued_page for link in page.rel_links(): File "/usr/lib/python2.7/dist-packages/pip/index.py", line 515, in rel_links for url in self.scraped_rel_links(): File "/usr/lib/python2.7/dist-packages/pip/index.py", line 542, in scraped_rel_links url = match.group(1) or match.group(2) or match.group(3) IndexError: no such group

HTTP error 404 while getting https://pypi.python.org/packages/source/s/setuptools/setuptools-4.0.1.tar.gz#md5=190b1d4470de9bae0b4414353e14700d (from https://pypi.python.org/pypi/setuptools) Could not install requirement setuptools>=0.7 (from distribute->mopidy-radio-de) because of error HTTP Error 404: Not Found Could not install requirement setuptools>=0.7 (from distribute->mopidy-radio-de) because of HTTP error HTTP Error 404: Not Found for URL https://pypi.python.org/packages/source/s/setuptools/setuptools-4.0.1.tar.gz#md5=190b1d4470de9bae0b4414353e14700d (from https://pypi.python.org/pypi/setuptools)

I hope that's readable and also useful.

Correction: I have found that I have additional playlists - the favourite stations from the config are available as playlists. Is that how the plugin is supposed to work? I thought I could browse radio.de stations with the plugin, as said above, like it works with the TuneIn Plugin.

Independantly from the intended functionality: The proxy bug for me still exists.

Thanks in advance for any help!

Matthias