Bug report #11275

Specifying output file in Clipper causes error

Added by Anita Graser about 10 years ago. Updated about 10 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Luigi Pirelli
Category:GDAL Tools
Affected QGIS version:2.4.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:19573

Description

The following error appears when selecting an output file in the raster clipper tool (and therefore the tool cannot be used):
(Tested with today's nightly OSGeo4W)

An error has occured while executing Python code:

Traceback (most recent call last):
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\GdalTools\\tools\\doClipper.py", line 120, in fillOutputFileEdit
    self.outputFormat = Utils.fillRasterOutputFormat(lastUsedFilter, outputFile)
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\GdalTools\\tools\\GdalTools_utils.py", line 230, in fillRasterOutputFormat
    filterName = re.sub('^.*\\] ', '', FileFilter.getFilterName( aFilter ))
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\GdalTools\\tools\\GdalTools_utils.py", line 479, in getFilterName
    return string.strip(re.sub('\\ \\(.*$', '', aFilter))
  File "C:\\OSGeo4W\\apps\\Python27\\lib\
e.py", line 151, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or buffer

Python version:
2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

QGIS version:
2.5.0-Master Master, 3f8a860

Python path: ['C:/Users/Anita/.qgis2/python/plugins\\\\processing', 'C:/OSGeo4W/apps/qgis-dev/./python', u'C:/Users/Anita/.qgis2/python', u'C:/Users/Anita/.qgis2/python/plugins', 'C:/OSGeo4W/apps/qgis-dev/./python/plugins', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\distribute-0.6.49-py2.7.egg', 'C:\\\\OSGeo4W\\\\bin\\\\python27.zip', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\DLLs', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\plat-win', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\lib-tk', 'C:\\\\OSGeo4W\\\\bin', 'C:\\\\OSGeo4W\\\\apps\\\\Python27', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\gdal-1.11.0-py2.7-win32.egg', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\jinja2-2.7.2-py2.7.egg', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\markupsafe-0.23-py2.7-win32.egg', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\python_dateutil-2.2-py2.7.egg', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\pytz-2014.2-py2.7.egg', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\shapely-1.2.18-py2.7-win32.egg', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\six-1.6.1-py2.7.egg', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\PIL', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\win32', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\win32\\\\lib', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\Pythonwin', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\wx-2.8-msw-unicode', 'C:\\\\OSGeo4W\\\\apps\\\\qgis-dev\\\\python\\\\plugins\\\\fTools\\\\tools', 'C:\\\\Users\\\\Anita\\\\.qgis2\\\\python\\\\plugins\\\\mmqgis/forms', '~/.qgis/python', '~/.qgis/python']

History

#1 Updated by Luigi Pirelli about 10 years ago

confirmed in current master 675ba9a on win7 osge4w and Debian (compiled)

#2 Updated by Luigi Pirelli about 10 years ago

pull request to solve the issue

tested on debian

https://github.com/qgis/QGIS/pull/1603

#3 Updated by Luigi Pirelli about 10 years ago

  • Pull Request or Patch supplied changed from No to Yes
  • Assignee set to Luigi Pirelli

auto assigned

#4 Updated by Luigi Pirelli about 10 years ago

tested on win7 too

#5 Updated by Luigi Pirelli about 10 years ago

tested on win7 also on 2.4 => can be backported

I tested random with other GdalTool methods and seems without regression. Please test more

#6 Updated by Alexander Bruy about 10 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Fixed in dbe4da806b

Also available in: Atom PDF