Skip to content
Browse files

Fix extension removal in exportVectorLayer

Taking the [:-4] slice from basename and splitext() try to do the same thing. Usually splitext() was failing silently, but if you're using the iterating function of processing, you can have filenames like <timestamp>.<sequenceno>.shp, which makes it cut off the sequencenumber and makes the OGR import fail.

I've left only the [:-4] slice because we check whether the file ends with .shp above anyway. This is also the way the grass7 file does it.
  • Loading branch information
bartnv committed Mar 11, 2016
1 parent 29d2d28 commit d7c477b07862f0aacfd2099d22d6ba4ce452f284
Showing with 1 addition and 1 deletion.
  1. +1 −1 python/plugins/processing/algs/grass/
@@ -465,7 +465,7 @@ def exportVectorLayer(self, orgFilename):
snap = self.getParameterValue(self.GRASS_SNAP_TOLERANCE_PARAMETER)
command += ' snap=' + unicode(snap)
command += ' dsn="%s"' % os.path.dirname(filename)
command += ' layer="%s"' % os.path.splitext(os.path.basename(filename)[:-4])[0]
command += ' layer="%s"' % os.path.basename(filename)[:-4]
command += ' output=' + destFilename
command += ' --overwrite -o'
return command

0 comments on commit d7c477b

Please sign in to comment.
You can’t perform that action at this time.