Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#3293 closed defect (fixed)

REPACK changes extension case and doesn't remove previous shapefile.

Reported by: jef Owned by: Even Rouault
Priority: normal Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords: shapefile driver
Cc:

Description

shapefiles with uppercase extensions are not replaced by a REPACK. Instead the new shapefiles have lower case extensions and the old files are not deleted.

Running 2292.py:

from osgeo import ogr

ds = ogr.Open("2292.SHP", 1)
l = ds.GetLayerByIndex(0)
l.DeleteFeature(0)
ds.ExecuteSQL("REPACK 2292");

gives:

$ ls; python 2292.py; ls
2292.DBF  2292.PRJ  2292.SHP  2292.SHX  2292.py
2292.DBF  2292.PRJ  2292.SHP  2292.SHX  2292.dbf  2292.py  2292.shp  2292.shx

(as of python-gdal 1.6.3-1 in Debian unstable)

Change History (8)

comment:2 Changed 10 years ago by Even Rouault

Owner: changed from warmerdam to Even Rouault

comment:3 Changed 10 years ago by Even Rouault

Keywords: shapefile driver added
Milestone: 1.6.4
Resolution: fixed
Status: newclosed

r18334 /trunk/gdal/ogr/ogrsf_frmts/shape/ogrshapelayer.cpp: SHAPEFILE driver : Preserve file extensions in REPACK operation (#3293)

r18335 /branches/1.6/gdal/ogr/ogrsf_frmts/shape/ogrshapelayer.cpp: SHAPEFILE driver : Preserve file extensions in REPACK operation (#3293)

r18336 /trunk/autotest/ogr/ogr_shape.py: Test that REPACK preserves file extensions (#3293)

comment:4 Changed 10 years ago by Even Rouault

The above commits also fixes memory leaks in error code paths, and a crash if a REPACK was attempted on a layer with only .shp and .shx, but no .dbf

comment:5 Changed 10 years ago by Mateusz Łoskot

I've fixed a silly bug (r18897) I introduced myself a while ago which is perhaps related. Perhaps it should also go to 1.7.2 branch, I'm not sure.

comment:6 Changed 10 years ago by Even Rouault

Mateusz,

Chaintanya will do the backport. Apparently, you missed part of the discussion on IRC. He was indeed about to fix the issue as he created ticket #3434. Well, better a bug fixed twice than ignored ;-).

comment:7 Changed 10 years ago by Mateusz Łoskot

Even,

No, I did not miss that part. If st hits a fan and I'm a troublemaker, I want to clean it myself.

comment:8 Changed 7 years ago by Even Rouault

Milestone: 1.6.4

Milestone 1.6.4 deleted

Note: See TracTickets for help on using tickets.