Hi devs,

I have  a strange behavior with QgsPathResolver that prevent layer to be loaded 
if a QgsProject read config file from relative path:

The problem has been reduced to the following behavior (pyQgis):

```
# Init a QgsPathResolver as with a relative path
pr = QgsPathResolver('./geography/data/france_parts.qgs')

pr.readPath('./france_parts/france_parts.shp')
# Output -> '/geography/data/france_parts/france_parts.shp' 
# Note the leading '/'
```

Worst:
```
pr = QgsPathResolver('../geography/data/france_parts.qgs')

pr.readPath('./france_parts/france_parts.shp')
# Output -> '/../geography/data/france_parts/france_parts.shp' 
# which is a meaningless path
```

The side effect is that if you do:
```
prj = QgsProject()
prj.read("./geography/data/france_parts.qgs")
```
then you get the error:
```
Qgis OGR: Cannot open /geography/data/france_parts/france_parts.shp.()
Qgis : 1 unavailable layers found:
Qgis :  * ./france_parts/france_parts.shp
```

This is with Qgis 3.6.1

Can anybody confirm that this behavior is a bug ? I will submit a PR  if this 
is the case.
Thanks,

Cheers
David

_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to