fix: disable configparser interpolation to support passwords with %#213
Open
chrisdebian wants to merge 3 commits into
Open
fix: disable configparser interpolation to support passwords with %#213chrisdebian wants to merge 3 commits into
chrisdebian wants to merge 3 commits into
Conversation
Hard-coded 4096x1344 values only work for one specific GoPro MAX recording mode. Use exiftool computed-value syntax so CroppedArea and FullPano tags are derived from actual ImageWidth/ImageHeight, making the command work for any output resolution (e.g. 4096x2048). CroppedAreaTopPixels = (ImageWidth/2 - ImageHeight) / 2 Closes mapilio#200
The upload loop was sending `bytes={offset}-{entity_size}/{entity_size}`
for every chunk. RFC 7233 requires the end value to be the last byte of
the *current chunk* (0-indexed, inclusive), not the total entity size.
For multi-chunk uploads this caused the server to reject intermediate
chunks with "Invalid Content-Range provided" (MapSyncer issue mapilio#87).
Fix: compute `chunk_end = offset + len(chunk) - 1` for non-empty chunks
and keep the existing sentinel value for the empty finalisation request.
Adds two unit tests covering single-chunk and multi-chunk Content-Range
header construction.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 mapilio#67 (MapSyncer) — root cause is in this config reader.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
configparser.ConfigParser()usesBasicInterpolationby default, which treats%in values as variable references (%m,%s, etc.). Any user whose password contains%gets an unrecoverable error at login time:Fix
Pass
interpolation=Noneto disable interpolation entirely:Credentials are now stored and retrieved literally regardless of content. This is the standard Python recommendation for config files that hold arbitrary user-supplied strings.
Test plan
%m,%s,%(foo)sno longer raisesInterpolationSyntaxError%continue to workFixes mapilio/MapSyncer#67
🤖 Generated with Claude Code