Fix %-interpolation error - #251
Open
me-and wants to merge 1 commit into
Open
Conversation
9c352d7 (Always pass an exception as first argument of ui.error, 2026-04-01) rearranged some of the arguments to `ui.error` in `folder/IMAP.py`, but while it removed one of the %-interpolation entries in the string to be interpolated, it didn't remove the argument in the interpolation tuple. This leads to errors like the below: File "offlineimap/folder/IMAP.py", line 863, in _fetch_from_imap "While fetching msg %r in folder %r." ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " Query: %s Retrying (%d/%d)" % ( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ e, uids, self.name, query, ~~~~~~~~~~~~~~~~~~~~~~~~~~ retry_num - fails_left, retry_num)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TypeError: %d format: a real number is required, not str Remove the argument from the interpolation tuple that has now been removed from the string, so the tuple parameters and string contents match again. Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>
me-and
added a commit
to me-and/nixcfg
that referenced
this pull request
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
9c352d7 (Always pass an exception as first argument of ui.error,
2026-04-01) rearranged some of the arguments to
ui.errorinfolder/IMAP.py, but while it removed one of the %-interpolationentries in the string to be interpolated, it didn't remove the argument
in the interpolation tuple. This leads to errors like the below:
Remove the argument from the interpolation tuple that has now been
removed from the string, so the tuple parameters and string contents
match again.
Signed-off-by: Adam Dinwoodie adam@dinwoodie.org
This PR
Additional information
Tested by applying the patch and re-running. I now get the expected error message: