Repository navigation
Preserve literal percent characters in saved credentials - #216
Merged
Merged
Conversation
configparser.ConfigParser() uses BasicInterpolation by default, which
treats % in values as variable references (e.g. %m, %s). A password
containing % raises:
InterpolationSyntaxError: invalid interpolation syntax in '...'
Pass interpolation=None to disable this behaviour so credentials are
stored and retrieved literally regardless of content.
Fixes #67 (MapSyncer) — root cause is in this config reader.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit 739bfd2)
3 tasks done
chrisdebian
approved these changes
Oct 31, 2026
chrisdebian
left a comment
Contributor
There was a problem hiding this comment.
Thanks, Ozcan, and thanks for keeping my authorship. I've reviewed this and approve it.
I checked that every reader and writer of the credentials file goes through load_config, so the one-line change covers them all. I ran the new tests locally: all five pass with the change, and four fail without it. The full suite passes (105 tests).
One side effect, and a good one: a saved password containing %% used to be read back as a single %. Now it comes back exactly as stored.
Once this is merged I'll close #213, as this replaces it.
Chris
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.
Applies @chrisdebian's config-only fix from #213 without the upload and GoPro changes stacked underneath it. Passwords containing
%were being interpreted by ConfigParser, which could raise an interpolation error or change a literal%%.Added five credential-file roundtrip cases for plain text,
%m,%s,%(missing)sand%%. Four failed before the fix; all five pass with it. Full suite: 105 passed.The original commit is retained with its author and cherry-pick reference. A package release will still be needed before this reaches installed users.