Skip to content

Keep double quotes in option values (fixes JSON options such as --boundary) - #275

Open
Ghost7K wants to merge 1 commit into
OpenDroneMap:masterfrom
Ghost7K:fix-json-option-quoting
Open

Ghost7K wants to merge 1 commit into
OpenDroneMap:masterfrom
Ghost7K:fix-json-option-quoting

Conversation

@Ghost7K

@Ghost7K Ghost7K commented Oct 12, 2026

Copy link
Copy Markdown

Since 7328aba ("Quote params and use shell: true"), shQuote() strips every double quote from an option value before wrapping it in double quotes for the shell. JSON options therefore reach ODM without their quotes, e.g. --boundary (also used by WebODM for the crop polygon) fails with:

run.py: error: argument --boundary: { type: FeatureCollection, features: [ ... ] } is not a valid JSON string.

Forum report: https://community.opendronemap.org/t/26994

This PR uses POSIX single quoting on non-Windows platforms ('value', embedded ' escaped as '\''), which passes the value to ODM literally. Windows behaviour is unchanged.

Tested with the real libs/odmRunner.js and a stub run.sh that applies ODM's path_or_json_string check, using the GeoJSON polygon from the forum post:

result
master (3.6.2) ... is not a valid JSON string., exit 2
this PR boundary parsed (FeatureCollection, 1 feature), exit 0

🤖 Generated with Claude Code

https://claude.ai/code/session_01A6nSKVeapxTouZcAYh6UF6

…ndary)

shQuote() stripped every double quote from option values before wrapping them
in double quotes for the shell. JSON options (--boundary, WebODM's crop
polygon) therefore reached ODM without quotes and failed with
"is not a valid JSON string". On POSIX use single quotes, which keep the value
literally; Windows behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6nSKVeapxTouZcAYh6UF6

This branch has not been deployed

No deployments
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 this pull request may close these issues.

1 participant