Skip to content
Browse files

BF: Builder can't open condition file when non-ASCII characters are i…

…ncluded in the file path in Python2.
  • Loading branch information
hsogo committed Dec 6, 2017
1 parent 4d4d1fc commit 32204a200c66e7b08f3ada758aa4bcd55b6d62a5
Showing with 3 additions and 3 deletions.
  1. +3 −3 psychopy/data/
@@ -268,12 +268,12 @@ def pandasToDictList(dataframe):
with open(fileName, 'rU') as fileUniv:
# use pandas reader, which can handle commas in fields, etc
trialsArr = pd.read_csv(fileUniv, encoding='utf-8')
logging.debug("Read csv file with pandas: {}".format(fileName))
logging.debug(u"Read csv file with pandas: {}".format(fileName))
trialList, fieldNames = pandasToDictList(trialsArr)

elif fileName.endswith(('.xlsx','.xls')) and haveXlrd:
trialsArr = pd.read_excel(fileName)
logging.debug("Read excel file with pandas: {}".format(fileName))
logging.debug(u"Read excel file with pandas: {}".format(fileName))
trialList, fieldNames = pandasToDictList(trialsArr)

elif fileName.endswith('.xlsx'):
@@ -288,7 +288,7 @@ def pandasToDictList(dataframe):
wb = load_workbook(filename=fileName, data_only=True)
ws = wb.worksheets[0]

logging.debug("Read excel file with openpyxl: {}".format(fileName))
logging.debug(u"Read excel file with openpyxl: {}".format(fileName))
# in new openpyxl (2.3.4+) get_highest_xx is deprecated
nCols = ws.max_column

0 comments on commit 32204a2

Please sign in to comment.