Skip to content

Commit

Permalink
[Spreadsheet] Excel File Import fix Py3 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Syres916 authored and wwmayer committed Sep 28, 2019
1 parent a4a42b3 commit dea7d20
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Mod/Spreadsheet/importXLSX.py
Expand Up @@ -57,6 +57,7 @@
import zipfile
import xml.dom.minidom
import FreeCAD as App
import sys

try: import FreeCADGui
except ValueError: gui = False
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit dea7d20

Please sign in to comment.