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

Let beet config -e work even when the configuration file can't be parsed #1123

Closed
azrdev opened this issue Nov 30, 2014 · 3 comments · Fixed by #1128
Closed

Let beet config -e work even when the configuration file can't be parsed #1123

azrdev opened this issue Nov 30, 2014 · 3 comments · Fixed by #1128
Labels
feature features we would like to implement

Comments

@azrdev
Copy link

azrdev commented Nov 30, 2014

Under some circumstances, beets and/or the config command fail, which can be fixed by changing the config file - thus, the user has to find & edit that by hand, since the command fails. Examples:

  1. Upon upgrade to v1.3.9, the discogs plugin wanted an auth token from me, which it requested on beets startup. Since I didn't supply one, beets failed, until I removed the plugins activation from the configuration
  2. Make a syntax error in the config file, e.g. a yaml "collection" without any value in it, and watch all beets commands fail since it cannot read the file. This works even when editing "through" beets.
@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Nov 30, 2014
@sampsyo
Copy link
Member

sampsyo commented Nov 30, 2014

Good point, although neither of these will be easy to solve.

Can you elaborate on how beets "failed" when discogs was broken? Was there a traceback?

@azrdev
Copy link
Author

azrdev commented Nov 30, 2014

$ beet version
To authenticate with Discogs, visit:
http://www.discogs.com/oauth/authorize?oauth_token=dLTKUZxKWdAbABnORoErTjorzZwEZpijPbzjLZXp
Enter the code: 
error: Discogs authorization failed
$ echo $?                                                                                                                                :(
1

Dunno if this counts as broken, I just didn't supply a code (since the link asks to log in with an account, which I don't have)

sampsyo added a commit that referenced this issue Nov 30, 2014
No need to authenticate for other commands.
@sampsyo sampsyo added feature features we would like to implement and removed needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." labels Nov 30, 2014
@sampsyo
Copy link
Member

sampsyo commented Nov 30, 2014

Aha, thanks for clarifying! I'm pushing a fix now that makes the plugin only ask for authentication when running an import, so that should solve that half.

The other component here will be somewhat trickier. We need to parse the configuration file before dispatching commands (for plugins' sake), so parse errors can get in the way. I think the best way to make config -e still work, which is a good idea, would be to hard-code that particular invocation. This would happen in beets.ui._raw_main after the global options are parsed but before we call _setup. I'll leave this open to remind us to do that.

@sampsyo sampsyo changed the title "config" command not always accessible, need to manually find & edit the file Let beet config -e work even when the configuration file can't be parsed Nov 30, 2014
geigerzaehler pushed a commit to geigerzaehler/beets that referenced this issue Dec 1, 2014
sampsyo added a commit that referenced this issue Dec 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature features we would like to implement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants