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

TypeError: not enough arguments for format string #14

Open
42B opened this issue Oct 26, 2018 · 0 comments · May be fixed by #12
Open

TypeError: not enough arguments for format string #14

42B opened this issue Oct 26, 2018 · 0 comments · May be fixed by #12

Comments

@42B
Copy link

42B commented Oct 26, 2018

KLog.log("could not delete function '%s', unknown error: %s" % str(e), "critical")

>>> try:
...     raise ValueError
... except Exception as e:
...     print("could not delete function '%s', unknown error: %s" % str(e))
... 
Traceback (most recent call last):
  File "<input>", line 2, in <module>
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<input>", line 4, in <module>
TypeError: not enough arguments for format string

# minimal example
>>> "could not delete function '%s', unknown error: %s" % "Exception string..."
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: not enough arguments for format string

It seems like adding self.func as the first string might be the answer:

KLog.log("could not delete function '%s', unknown error: %s" % (self.func, str(e)), "critical")
@42B 42B linked a pull request Oct 26, 2018 that will close this issue
6 tasks
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

Successfully merging a pull request may close this issue.

1 participant