I am trying to use the ExecuteScript processor to run a python program that connects to irc and posts messages. I have python3 on my system but when I paste the python code into the ExecuteScript processor I get the following error:
Unable to load script: TypeError: str() takes at most 1 arguments (2 given) in <script> at line number 14: javax.script.ScriptException: TypeError: str() takes at most 1 arguments (2 given) in <script> at line number 14
javax.script.ScriptException: AttributeError: 'NoneType' object has no attribute 'strip' in
that line of code looks like below:
ircsock.send(bytes("USER "+ botnick +" "+ botnick +" "+ botnick + " " + botnick + "\n", "UTF-8"))
ircmsg = ircmsg.strip('\n\r')
in the python script I am pointing to python3
#!/usr/local/bin/python3.7
import socket
ircsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
How can i get the ExecuteScript processor to use python3? I believe the issue is that NiFi is still using python 2.7 in /usr/bin.