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.


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(
at org.python.core.PymakeException( 1638)
at org.python.core.PymakeException( 1642)
at org.python.core.PymakeException( 1646)
at org.python.core.PymakeException( 1650)$1(module:funcionesAutoSeguroLineas:52)
at org.python.pycode._pyx36.call_function(module:funcionesAutoSeguroLineas)$3(module:funcionesAutoSeguroLineas:211)
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(
at com.inductiveautomation.ignition.client.script.DesignerSystemUtilities.lambda$_invokeAsyncImpl$1(
at java.base/ 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: 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.