I'm having trouble merging shapefiles in QGIS. I'm using plugin ftools 0.6.1 and I get this:

enter image description here

Any workarounds someone may know of?

  • Use QGSI latest release 1.7.4
    – Mapperz
    Apr 17, 2012 at 17:11
  • I am using it already. Apr 17, 2012 at 17:15
  • Did you every figure out the problem? I seem to be getting the same error, but I'n not sure why. I'm essentially merging buffer layers, so I'm not sure what the issue would be.
    – afwatl
    May 16, 2012 at 18:04

3 Answers 3


There is a considerable difference between the core plugin, fTools, in version 1.7.4 and latest (1.8 RC, or 1.9 master branch). I'm guessing the new version is not quite ready for release, as its __init__.py file has not been updated beyond the same 0.6.1 version.

However, I was able to do a quick fix to get this function of the plugin to work in 1.7.4. Open the noted file that exhibits the error in a good text editor (BBEdit or TextWrangler on Mac). Here is where it is located...

On Win: [drive letter]:\OSGeo4W\apps\qgis\python\plugins\fTools\tools\doMergeShapes.py

On Mac: /Applications/QGIS.app/Contents/Resources/python/plugins/fTools/tools/doMergeShapes.py

You will generally need to make the file write-able and authenticate when saving on Mac, as the core files are usually owned by a different user.

The error references line 124:

if self.inEncoding == None:
AttributeError: 'Dialog' object has no attribute 'inEncoding'

This means that self.inEncoding has not yet been defined as an instance attribute, but is being tested against None. Merely adding an assignment for self.inEncoding in the Dialog's __init__ method allows the plugin to work. Add a new line below line 22, so that line 22 and 23 look like this:

self.outFileName = None
self.inEncoding = None  # added this line

This allows the plugin to work, but the 1.8 RC version has 23 changes over the 1.7.4 version in this file alone. So, it could be the new version also fixes some other issues.


I was able to merge my buffers without the error you mentioned by using QGIS 1.9.90-Alpha (Code revision 20e5f5a). That doesn't solve the problem, but it does circumvent it. Once I was done, I just added the shape file in QGIS 1.7.4


Check the Shapes Encoding. What is the origin of those shape files? maybe it were generated by a messy application.

  • The shapefiles are ok. Apr 17, 2012 at 17:38
  • with that similar error, I changed the Encoding for all files (Properties > General > Provider-Specific Options > Encoding) from System to UTF-8 (which matched other layers in my map). Still got the same error.
    – afwatl
    May 16, 2012 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.