Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mopidy --list-settings fails on fresh install #63

Closed
grunskis opened this issue Feb 9, 2011 · 2 comments
Closed

mopidy --list-settings fails on fresh install #63

grunskis opened this issue Feb 9, 2011 · 2 comments
Assignees
Labels
C-bug Category: This is a bug
Milestone

Comments

@grunskis
Copy link
Contributor

grunskis commented Feb 9, 2011

Stack trace:

Traceback (most recent call last):
  File /usr/lib/python2.6/runpy.py, line 122, in _run_module_as_main
    __main__, fname, loader, pkg_name)
  File /usr/lib/python2.6/runpy.py, line 34, in _run_code
    exec code in run_globals
  File /home/martins/source/tmp/mopidy/mopidy/__main__.py, line 17, in <module>
    main()
  File /home/martins/source/tmp/mopidy/mopidy/__main__.py, line 14, in main
    CoreProcess().run()
  File /home/martins/source/tmp/mopidy/mopidy/core.py, line 20, in __init__
    self.options = self.parse_options()
  File /home/martins/source/tmp/mopidy/mopidy/core.py, line 40, in parse_options
    return parser.parse_args()[0]
  File /usr/lib/python2.6/optparse.py, line 1394, in parse_args
    stop = self._process_args(largs, rargs, values)
  File /usr/lib/python2.6/optparse.py, line 1434, in _process_args
    self._process_long_opt(rargs, values)
  File /usr/lib/python2.6/optparse.py, line 1509, in _process_long_opt
    option.process(opt, value, values, self)
  File /usr/lib/python2.6/optparse.py, line 788, in process
    self.action, self.dest, opt, value, values, parser)
  File /usr/lib/python2.6/optparse.py, line 808, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File /home/martins/source/tmp/mopidy/mopidy/utils/settings.py, line 144, in list_settings_optparse_callback
    if key.endswith('PASSWORD') and len(value):
TypeError: object of type 'NoneType' has no len()
@grunskis
Copy link
Contributor Author

grunskis commented Feb 9, 2011

btw I have this fixed in my fork grunskis@f33c65d

@jodal
Copy link
Member

jodal commented Feb 9, 2011

Thanks for the bug report and the patch! :-)

I've applied your patch to the develop branch and did a followup commit, e150a24, with some changes. See the commit message for an explanation of my changes.

@ghost ghost assigned jodal Apr 10, 2011
@jodal jodal closed this as completed Apr 11, 2011
adamcik pushed a commit to adamcik/mopidy that referenced this issue Apr 19, 2011
- Moved mask_value_if_secret til after the method using it. Most
  important/interesting method first, lower level/more detailed later.
- Made the logic in mask_value_if_secret simpler to understand, I think,
  by making the two different cases more obvious.
- Split the test in two, as it actually tested two different cases.
- Changed the test names to explain what should happen, and not just
  what is tested.
- Add a new test that tests the case which caused the crash: a setting
  being None.
adamcik pushed a commit to adamcik/mopidy that referenced this issue Apr 19, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants