[Spreadsheet] Excel File Import fix Py3 bug

Please see discussion https://forum.freecadweb.org/viewtopic.php?f=3&t=39653
This commit is contained in:
Syres916
2019-09-28 12:18:33 +02:00
committed by wmayer
parent a4a42b36e4
commit dea7d2080b
+5 -1
View File
@@ -57,6 +57,7 @@ known issues:
import zipfile
import xml.dom.minidom
import FreeCAD as App
import sys
try: import FreeCADGui
except ValueError: gui = False
@@ -371,7 +372,10 @@ def handleCells(cellList, actCellSheet, sList):
if cellType == 'n':
actCellSheet.set(ref, theValue)
if cellType == 's':
actCellSheet.set(ref, (sList[int(theValue)]).encode('utf8'))
if sys.version_info.major >= 3:
actCellSheet.set(ref, (sList[int(theValue)]))
else:
actCellSheet.set(ref, (sList[int(theValue)]).encode('utf8'))
def handleWorkBook(theBook, sheetDict, Doc):