ERROR none type object has no attribute writeBytes

Hello everyone, I have a problem when I get this error and then says that the port can not be opened

There’s a problem with your code. Without seeing your code (ideally, posted here in plain text format inside a preformatted block) we can’t help.

3 Likes

I will do it the next time I got this error because we are in tests, the thing is that there is an script in background and stays there but we don’t know why

[AWT-EventQueue-0] Error com.inductiveautomation.ignition.client.util.gui.ErrorUtil - Error running function from fpmi.system.invokeAsynchronous

com.inductiveautomation.ignition.common.script.jythonExecException: AttributeError: ‘NoneType’ object has no attribute ‘writeBytes’
at org.python.core.PyException.doRaise(PyException.java:211)
at org.python.core.PymakeException(Py.java: 1638)
at org.python.core.PymakeException(Py.java: 1642)
at org.python.core.PymakeException(Py.java: 1646)
at org.python.core.PymakeException(Py.java: 1650)
at.org.python.pycode._pyx36.e$1(module:funcionesAutoSeguroLineas:52)
at org.python.pycode._pyx36.call_function(module:funcionesAutoSeguroLineas)
at.org.python.core.PyTableCode.call(PyTableCode.java:173)
at.org.python.core.PyBaseCode.call(PyBaseCode.java:168)
at.org.python.core.PyFunction.call(PyFunction.java:437)
at.org.python.pycode._pyx36.threadSectorImpar$3(module:funcionesAutoSeguroLineas:211)
at.org.python.pycode.pyx36.call_function(module:funcionesAutoSeguroLineas)
at.org.python.core.PyTableCode.call(PyTableCode.java:173)
at.org.python.core.PyBaseCode.call(PyTableCode.java:306)
at.org.python.core.PyFunction.function_call
(PyFunction.java:474)
at.org.python.core.PyFunction.call(PyFunction.java:469)
at.org.python.core.PyFunction.call(PyFunction.java:464)
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:849)
at com.inductiveautomation.ignition.client.script.DesignerSystemUtilities.lambda$_invokeAsyncImpl$1(DesignerSystemUtilities.java:140)
at java.base/java.lang.Thread.run(Unknow Source)
Caused by: org.python.core.PyException:AttributeError: ‘NoneType’ object has no attribute ‘writeBytes’
…20 common frames omitted

[AWT-EventQueue-0] Error com.inductiveautomation.ignition.client.util.gui.ErrorUtil - Error running function from fmpi.system.invokeAsynchronous
com.inductiveautomation.ignition.common.script.JythonExceException: java.io.IOException: java.io.IOException: Port COM9 has not been opened.

In your funcionesAutoSeguroLineas script library, are you calling system.util.invokeAsynchronous somewhere? Seems like you are and it’s happening within that call.

Post your funcionesAutoSeguroLineas script

I think this is relevant.

2 Likes