I struggled with this issue as well. Note: I am using a way outdated version of Psychopy (2025.1.1), so maybe this is not an issue anymore. But by using a TextBox component for inputting text, I can reproduce the problem with no effort.
Setup:
Running the experiment and entering the following text:
This "test" will not work, though. Lets, add, some, more, commas
maybe even
some
line breaks?
Will generate this faulty csv:
Plain text contents of csv:
thisRow.t,notes,r_read_word.started,textbox.started,key_resp_2.started,r_read_word.stopped,textbox.text,key_resp_2.keys,key_resp_2.rt,key_resp_2.duration,participant,session,date,expName,expVersion,psychopyVersion,frameRate,expStart,
,,0.004067899993970059,0.008697099998244084,0.008697099998244084,36.312751699995715,"This "test" will not work, though. Lets, add, some, more, commas
maybe even
some
line breaks?",0,36.28649900000892,None,470535,001,2026-07-28_10h50.57.603,untitled,,2025.1.1,59.97487052815985,2026-07-28 10h51.01.039077 +0200,
As you can see, it is not properly escaped.