fix: escape '#' in SQLite URI paths to prevent truncation#2150
Merged
steveyegge merged 1 commit intosteveyegge:mainfrom Feb 26, 2026
Merged
fix: escape '#' in SQLite URI paths to prevent truncation#2150steveyegge merged 1 commit intosteveyegge:mainfrom
steveyegge merged 1 commit intosteveyegge:mainfrom
Conversation
Paths containing '#' (e.g., /workdir/#category/project) were silently truncated by the SQLite URI parser because '#' starts a URI fragment. This caused 'bd list' and other commands to fail with "unable to open database file" when the working directory contained '#'. Fixes steveyegge#2115 Co-Authored-By: Claude <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
Fixes #2115
Paths containing
#(e.g.,/workdir/#category/project) were silently truncated by the SQLite URI parser because#starts a URI fragment per RFC 3986. This causedbd listand other commands to fail with:Changes
cmd/bd/doctor_health.go: Escape#as%23in the database path before constructing the SQLite URIcmd/bd/migrate_dolt.go: Same fix for the SQLite extraction path used during migrationRoot Cause
The SQLite URI
file:/path/#dir/db.sqlite?mode=rois parsed as:/path/(truncated at#)dir/db.sqlite?mode=ro(silently discarded)After the fix:
file:/path/%23dir/db.sqlite?mode=ro— the#is percent-encoded so the full path is preserved.🤖 Generated with Claude Code