Skip to content

New CLI is too tolerant of strange file names #12759

@dbaston

Description

@dbaston

What is the bug?

I am using a minimal build that does not have the Postgres driver enabled. Running the following:

gdal vector convert /tmp/out.shp "PG:host=172.17.0.2 user=postgres dbname=postgres"

Creates a directory called PG:host=172.17.0.2 user=postgres dbname=postgres to which it writes a file called out.shp. I guess this is longstanding behavior for ogr2ogr but I think the new CLI is an opportunity to break it.

I think a reasonable behavior would be "Error: could not identify a driver for output name "PG:host=172.17.0.2 user=postgres dbname=postgres"`. Recognizing the driver prefix and saying "Driver "Postgres" is not enabled" would be a bonus, but not necessary.

Steps to reproduce the issue

Above

Versions and provenance

master

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions