Where as Python Cmd expects _io.TextIOWrapper not str:
# ./sfcli.py -e /tmp/asdf
Traceback (most recent call last):
File "/root/Desktop/spiderfoot/./sfcli.py", line 1422, in <module>
s.cmdloop()
File "/usr/lib/python3.11/cmd.py", line 132, in cmdloop
line = self.stdin.readline()
^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'readline'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/Desktop/spiderfoot/./sfcli.py", line 1424, in <module>
cin.close()
^^^^^^^^^
AttributeError: 'str' object has no attribute 'close'
The
-e
argument clobbersstdin
with file contents as a string:https://github.com/smicallef/spiderfoot/blob/e84db07ffa681f1acd9445a2ffdc9f28ffe0330a/sfcli.py#L1368-L1379
Where as Python
Cmd
expects_io.TextIOWrapper
notstr
: