[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-27 13:04:57 +01:00
committed by wmayer
parent 1a2370cd91
commit 6495902fc2

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):