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

Whipper example config file: % character in inline comment causes InterpolationSyntaxError #443

Closed
Aquan1412 opened this issue Jan 3, 2020 · 4 comments
Labels
Accepted Accepted issue on our roadmap Bug Generic bug: can be used together with more specific labels Priority: medium Medium priority
Milestone

Comments

@Aquan1412
Copy link

Aquan1412 commented Jan 3, 2020

whipper.log.gz
When I try to use whipper to rip a cd I always get a configparser error:

~ >>> whipper cd rip
INFO:whipper.command.cd:using configured read offset 103
Traceback (most recent call last):
  File "/usr/bin/whipper", line 11, in <module>
    load_entry_point('whipper==0.9.0', 'console_scripts', 'whipper')()
  File "/usr/lib/python3.8/site-packages/whipper/command/main.py", line 42, in main
    cmd = Whipper(sys.argv[1:], os.path.basename(sys.argv[0]), None)
  File "/usr/lib/python3.8/site-packages/whipper/command/basecommand.py", line 114, in __init__
    self.cmd = self.subcommands[self.options.remainder[0]](
  File "/usr/lib/python3.8/site-packages/whipper/command/basecommand.py", line 114, in __init__
    self.cmd = self.subcommands[self.options.remainder[0]](
  File "/usr/lib/python3.8/site-packages/whipper/command/basecommand.py", line 67, in __init__
    val = config.Config().get(config_section, action.dest)
  File "/usr/lib/python3.8/site-packages/whipper/common/config.py", line 70, in get
    return self._getter('', section, option)
  File "/usr/lib/python3.8/site-packages/whipper/common/config.py", line 65, in _getter
    return method(section, option)
  File "/usr/lib/python3.8/configparser.py", line 799, in get
    return self._interpolation.before_get(self, section, option, value,
  File "/usr/lib/python3.8/configparser.py", line 395, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/lib/python3.8/configparser.py", line 442, in _interpolate_some
    raise InterpolationSyntaxError(
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: "%' must be represented '%%'"

Steps to reproduce the error:

  1. run whipper cd rip

I'm using Manjaro Linux and installed whipper from the "community" repository.
I didn't change the default config file (apart from adjusting the drive offset), so it currently looks like this:

[whipper.cd.rip]
unknown = True
output_directory = ~/Musik
track_template = new/%%A/%%y - %%d/%%t - %%n	; note: the format char '%' must be represented '%%'
disc_template = %(track_template)s

Any ideas what might be the problem?

@github-actions
Copy link

github-actions bot commented Jan 3, 2020

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing instructions.

@JoeLametta
Copy link
Collaborator

JoeLametta commented Jan 4, 2020

Hi, could you try to just remove the disc_template line (or replace it with the one in the README, the value you're using is non-standard) from whipper's config file and see if the issue is solved?

@Aquan1412
Copy link
Author

Thank you, that was one part of the problem. The other part was, that apparently also the mention of '%' in comments isn't allowed, so I also had to remove the comment behind track template before it worked.

JoeLametta added a commit that referenced this issue Jan 4, 2020
This avoids `%` character interpolation leading to `InterpolationSyntaxError`.
Added a comment explaining this too.

Fixes #443.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
@JoeLametta JoeLametta added Accepted Accepted issue on our roadmap Bug Generic bug: can be used together with more specific labels Priority: medium Medium priority labels Jan 4, 2020
@JoeLametta JoeLametta added this to the 1.0 milestone Jan 4, 2020
@JoeLametta
Copy link
Collaborator

Thanks, fixed the bug about the InterpolationSyntaxError caused by the % character in the inline comment with commit 150f0d5.

@JoeLametta JoeLametta changed the title configparser Error Whipper example config file: % character in inline comment causes InterpolationSyntaxError Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Bug Generic bug: can be used together with more specific labels Priority: medium Medium priority
Projects
None yet
Development

No branches or pull requests

2 participants