Bug report #19655

GDAL tools - path not properly escaped

Added by Ta Gru over 2 years ago. Updated over 2 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/GDAL
Affected QGIS version:3.2 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:27480

Description

When using ogrinfo from the GDAL tools with a file path which contains char '-' and empty characters, the command is not correctly executed. Shouldn't the path in the GDAL command be surrounded by quotation marks?

Processing algorithm…
Algorithmus Vektorinformation startet…
Input parameters:
{ 'INPUT' : 'D:/OneDrive - Test/_Projekte/20180712_GisImporter_Shape/Sections/FOC_Sections.shp', 'NO_METADATA' : False, 'OUTPUT' : 'C:/Users/username/AppData/Local/Temp/processing_9978832b89694b56ad3001db50da2fbc/5df334e2e1054468a4976fa2b555f4bc/OUTPUT.html', 'SUMMARY_ONLY' : True }

GDAL command:
ogrinfo -al -so D:\OneDrive - Dynamic Design Informationssysteme GmbH\_Projekte\20180712_GisImporter_Shape\Sections\FOC_Sections.shp
GDAL command output:

FAILURE: Unknown option name '-'

Usage: ogrinfo [--help-general] [-ro] [-q] [-where restricted_where|@filename]

[-spat xmin ymin xmax ymax] [-geomfield field] [-fid fid]

[-sql statement|@filename] [-dialect sql_dialect] [-al] [-rl] [-so] [-fields={YES/NO}]

[-geom={YES/NO/SUMMARY}] [-formats] [[-oo NAME=VALUE] ...]

[-nomd] [-listmdd] [-mdd domain|`all`]*

[-nocount] [-noextent]

datasource_name [layer [layer ...]]

Execution completed in 0.14 seconds
Results:
{'OUTPUT': 'C:/Users/tanja/AppData/Local/Temp/processing_9978832b89694b56ad3001db50da2fbc/5df334e2e1054468a4976fa2b555f4bc/OUTPUT.html'}

Version Information:

QGIS-Version 3.2.2-Bonn
QGIS-Codeversion commit:26842169e9
Kompiliert gegen Qt 5.9.2
Laufendes Qt 5.9.2
Kompiliert mit GDAL/OGR 2.2.4
Läuft mit GDAL/OGR 2.2.4
Kompiliert mit GEOS 3.6.1-CAPI-1.10.1
Läuft mit GEOS 3.6.1-CAPI-1.10.1 r0
PostgreSQL-Client-Version 9.2.4
SpatiaLite-Version 4.3.0
QWT-Version 6.1.3
QScintilla2-Version 2.10.1
PROJ.4-Version 493

Associated revisions

Revision d0a705fa
Added by Nyall Dawson over 2 years ago

[processing][gdal] Fix ogrinfo algorithm fails when path name has spaces

Fixes #19655

Revision 821aad43
Added by Nyall Dawson over 2 years ago

[processing][gdal] Fix ogrinfo algorithm fails when path name has spaces

Fixes #19655

(cherry-picked from d0a705f)

History

#2 Updated by Giovanni Manghi over 2 years ago

  • Category changed from GDAL Tools to Processing/GDAL

#3 Updated by Jürgen Fischer over 2 years ago

  • Description updated (diff)

#4 Updated by Nyall Dawson over 2 years ago

  • Status changed from Open to In Progress

#5 Updated by Nyall Dawson over 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

#6 Updated by Giovanni Manghi over 2 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF