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

Error with string formatting #202

Open
laulaz opened this issue Dec 9, 2020 · 2 comments
Open

Error with string formatting #202

laulaz opened this issue Dec 9, 2020 · 2 comments

Comments

@laulaz
Copy link

laulaz commented Dec 9, 2020

When trying to render an error message, mr.developer fails:

mr.developer: Updated 'my.package' with git.
Traceback (most recent call last):
  File "mr.develope/mr/developer/common.py", line 181, in worker
    for lvl, msg in wc._output:
ValueError: too many values to unpack

This is because of wrong string formatting:
self.output((logger.info, "No such branch %r", branch))

I saw several of those, but didn't check all of them yet.

@fschulze
Copy link
Owner

fschulze commented Dec 9, 2020

This isn't wrong string formatting, see https://docs.python.org/3/howto/logging.html#logging-variable-data (I think the main reason the formatting isn't done right away is for performance, if the string doesn't need to be output, the formatting can be skipped, which makes a huge difference in quite a lot of cases)

But the handling in common.py needs to be fixed to support the arguments.

@laulaz
Copy link
Author

laulaz commented Dec 9, 2020

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants