The fixes to parse the command along with the pipe options broke
a simple shell command such as '/sbin/sysctl hw.ncpu' on FreeBSD.
This patch fixes the shell command by passing a string for the
various options.
The unit test has been updated to catch errors and report them.
Closes#4951
Turns out subprocess.Popen operates on posix mode. Also, there is an
issue with previous implementation of pipe command that is fixed by
Chris. Now, it can also accepts command in form of a string. The unit
test for that is added via this patch.
- Allow unicode as a type on python2. The unicode type is not
present on python3 so make the support conditional.
- Add some more diag prints to aid debugging.
Closes#3964
- Use the 'read1' file handle call to return if any data is queued
for reading from stdout or stderr.
- Flush the stdin pipe in the writer thread.
These changes let the execute module work on Python2 and Python3.
- Use buffered output on the stdout and stderr streams from
child processors.
- Simplify the read thread line processing to improve performance.
- Disable 'close_fds' as it slows down python3's popen call.
- Update the importing of rtemstoolkit modules.
This change drops the overhead of capturing the process output. The
io module in Python is similar to the POSIX API for a file read
where a read will return up to the buffer size rather than blocking
until the buffer is full.
The conversion to Python3 added an eval() call which is wrong.
Fix the spelling in execute.
Fix labels in the tester gdb locking.
Check the debug-trace arguments.
Close#2642.
Installing PYO and PYC does not work so disable this. Move the
Python check to the top level and have a single place.
Fix the install paths a revert the 'from . import' changes. This
is resolved by installing into the correct paths.