Hi I’m trying to import a csv file to database via project scripting.
I’m able to import 3 files. But on one file i get this error
Error running action ‘component.onActionPerformed’ on Page/LOGSHEET/T2OPERATION@D/root/TabContainer/FCdata/TCdataentry/FCproduction/FCmain/FCbalance/FCcommand/Button: Traceback (most recent call last): File " ", line 6, in runAction File " ", line 120, in t2axjobimport File “C:\Program Files\Inductive Automation\Ignition\user-lib\pylib\csv.py”, line 104, in next row = self.reader.next() at org.python.core.PyString. (PyString.java:57) at org.python.core.PyString. (PyString.java:70) at org.python.core.PyString. (PyString.java:74) at org.python.modules._csv.PyReader.parse_save_field(PyReader.java:249) at org.python.modules._csv.PyReader.parse_process_char(PyReader.java:165) at org.python.modules._csv.PyReader.iternext(PyReader.java:92) at org.python.core.PyIterator.next(PyIterator.java:45) at jdk.internal.reflect.GeneratedMethodAccessor428.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Cannot create PyString with non-byte value
May I know what is the root cause? Something to do with csv file or coding.
data_string = system.file.readFileAsString(path)
reader = csv.DictReader(StringIO(data_string))