Missing csv data files

There are some differences in the experiments that worked in the past and now by comparing lastrun files. Could this explain anything?

This is a file that saved data output:

# Store info about the experiment session
expName = u'stroop'  # from the Builder filename that created this script
expInfo = {'participant':'', 'session':'01'}
dlg = gui.DlgFromDict(dictionary=expInfo, title=expName)
if dlg.OK == False:
    core.quit()  # user pressed cancel
expInfo['date'] = data.getDateStr()  # add a simple timestamp
expInfo['expName'] = expName

# Data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc
filename = _thisDir + os.sep + u'data' + os.sep + '%s_%s' % (expInfo['participant'], expInfo['date'])

# An ExperimentHandler isn't essential but helps with data saving
thisExp = data.ExperimentHandler(name=expName, version='',
    extraInfo=expInfo, runtimeInfo=None,
    originPath=u'/Users/Me/Documents/PsychoPy Demos/stroopExtended/stroop.psyexp',
    savePickle=True, saveWideText=True,
    dataFileName=filename)

And this is what my non-data saving experiment looks like

# Store info about the experiment session
expName = 'RhythmPercept_discrim'  # from the Builder filename that created this script
expInfo = {u'session': u'001', u'participant': u'', u'order': u'A OR B?'}
dlg = gui.DlgFromDict(dictionary=expInfo, title=expName)
if dlg.OK == False:
    core.quit()  # user pressed cancel
expInfo['date'] = data.getDateStr()  # add a simple timestamp
expInfo['expName'] = expName

# Data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc
filename = _thisDir + os.sep + u'data/%s_%s_%s' % (expInfo['participant'], expName, expInfo['date'])

# An ExperimentHandler isn't essential but helps with data saving
thisExp = data.ExperimentHandler(name=expName, version='',
    extraInfo=expInfo, runtimeInfo=None,
    originPath=u'/Users/Me/Desktop/MPhil/Materials/RhythmDiscrim/RhythmPercept_discrim.psyexp',
    savePickle=True, saveWideText=True,
    dataFileName=filename)

Anything obvious jump out?

Edited again in case someone else has this problem and a better solution hasn’t been posted below: I put the following code component into my trial routine (I added it to both the begin routine and end experiment properties, since it doesn’t seem effective in any other combination that I tried)

thisExp.saveAsWideText(thisExp.dataFileName+'.csv', delim=',')