`--json` output is not valid JSON for `search --export`, `image upload <dir>`, `model upload` and `version download`
Maintainer antworten meist innerhalb von 1 Tag
@cdeil arbeitet bereits daran.
Seit 07.10.2026.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 20/100
Rechercherichtung
Start with search.py::_do_export, image.py::_handle_upload_directory, model.py::_upload_model, and version.py::_download, then read CLI-COMMANDS.md and CLAUDE.md for the JSON-output contract and SDK-output guidance. The issue says the reporter is sending a PR right away, so check for that work before starting; done means each command's stdout parses with json.loads while progress and failure messages remain visible.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
CLI-COMMANDS.md describes --json as "Structured JSON output (for agents and piping)", and CLAUDE.md asks handlers to wrap SDK calls in suppress_sdk_output(). Four handlers call SDK methods that print to stdout outside such a block, so stdout is a mix of plain-text status lines and the pretty-printed JSON result, and json.loads(stdout) or | jq fails (roboflow 1.7.0 and current main; --quiet does not change it):
| Command | Handler → SDK call | Printed to stdout before the JSON |
|---|---|---|
search --export |
search.py::_do_export → Workspace.search_export() |
"Export started (id=...)...", "If this takes too long, ...", "Search export extracted to ..." |
image upload <dir> |
image.py::_handle_upload_directory → Workspace.upload_dataset() |
"Uploading to existing project ...", one [UPLOADED]/[DUPLICATE]/[ERR] line per image |
model upload |
model.py::_upload_model → Roboflow.workspace(), Workspace.project(), Version.deploy() / Workspace.deploy_model() |
"loading Roboflow workspace...", "loading Roboflow project..." (this handler does not use suppress_sdk_output() at all), "View the status of your deployment at: ...", "Share your model with the world at: ..." (or the error) |
version download |
version.py::_download → Version.download() |
when the format is generated on demand: "\rExporting format coco in progress : 40.0%", "\rVersion export complete for coco format" |
Example (offline: HTTP mocked with responses, command run with typer.testing.CliRunner):
$ roboflow --json search "project:my-project" --export -l out
Export started (id=exp1). Polling for completion...
If this takes too long, you can check the export status at: https://api.roboflow.com/my-workspace/search/export/exp1?api_key=YOUR_API_KEY
Search export extracted to /.../out
{
"status": "completed",
"path": "/.../out"
}
Proposal: in JSON mode, run these SDK calls inside contextlib.redirect_stdout(sys.stderr), so progress stays visible and stdout stays JSON, with one test per handler that parses stdout with json.loads. Simply suppressing the output with suppress_sdk_output() would hide the per-image [ERR] lines of image upload, which are currently its only failure signal (#545). A more general alternative: in JSON mode, redirect sys.stdout to stderr for the whole command and let output() write to the original stdout, which would also cover future handlers.
I'm sending a PR for the per-handler variant right away.
cc @yeldarby
- Vorherrschende Sprache
- Python
- Sterne
- 634
- Forks
- 144
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 18
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus roboflow/roboflow-python
-
Failed uploads are reported as success: Version.deploy() / Workspace.deploy_model() don't raise, and roboflow model upload / roboflow image upload <dir> exit 0Evtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
roboflow/roboflow-python#545 ·
Maintainer antworten meist innerhalb von 1 Tag
-
RLE segmentation mask visible in dataset thumbnail, but invisible in annotation preview/editorOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
roboflow/roboflow-python#505 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
roboflow/roboflow-python#433 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Dataset Download StuckOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
roboflow/roboflow-python#429 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
roboflow/roboflow-python#427 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in roboflow/roboflow-python
Ähnliche Issues
-
changelog investigate
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
ramnes/notion-sdk-py#423 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 89/100
duckdb/duckdb-web#7514 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
jbacalso24/mimry#525 ·
Maintainer antworten meist innerhalb von 1 Tag