DXF import for a file exported from QGIS fails with IndexError: list index out of range
Closed, ResolvedPublic

Description

Blender Version
Broken: 2.79 release 5bd8ac9

Importing a DXF file exported from QGIS fails with following exception.
Same DXF opens in Autodesk DWG TrueView 2018. It is a pretty simple map with a few areas.

Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_import_dxf\__init__.py", line 540, in execute
    proj_dxf, proj_scn, self.represent_thickness_and_width, self.import_atts, dxf_unit_scale)
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_import_dxf\__init__.py", line 119, in read
    errors = do.entities(os.path.basename(filename).replace(".dxf", ""), new_scene)
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_import_dxf\dxfimport\do.py", line 1614, in entities
    self.combined_objects((en for en in self.dwg.modelspace() if is_.combined_entity(en)), scene)
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_import_dxf\dxfimport\do.py", line 1518, in combined_objects
    o = self._call_object_types(TYPE, by_att, group, name, scene, False)
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_import_dxf\dxfimport\do.py", line 1367, in _call_object_types
    o = type_func(entity, scene, name)
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_import_dxf\dxfimport\do.py", line 1288, in object_curve
    self._thickness_and_width(o, en, scene)
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\addons\io_import_dxf\dxfimport\do.py", line 1138, in _thickness_and_width
    w = entity.width[0][0] if hasattr(entity, "width") else 0
IndexError: list index out of range

Exact steps for others to reproduce the error

Enable DXF import.

Import the attached file.

Details

Type
Bug