From dd4b93c2014b3e9b4cbe0974d83fa45207f98189 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Tue, 2 Jul 2019 12:31:43 +0200 Subject: [PATCH] Materials: Py2 fix --- src/Mod/Material/Material.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Mod/Material/Material.py b/src/Mod/Material/Material.py index 67bc995541..bfbabc71a9 100644 --- a/src/Mod/Material/Material.py +++ b/src/Mod/Material/Material.py @@ -20,6 +20,7 @@ # * * # *************************************************************************** +import sys import FreeCAD @@ -70,7 +71,10 @@ def importFCMat(fileName): ) Config = configparser.RawConfigParser() Config.optionxform = str - Config.read(fileName, encoding='utf-8') # respect unicode filenames + if sys.version_info.major >= 3: + Config.read(fileName, encoding='utf-8') # respect unicode filenames + else: + Config.read(fileName) dict1 = {} for section in Config.sections(): options = Config.options(section)