# Process call fails when issued from Robot Framework

**URL:** <https://forum.robotframework.org/t/process-call-fails-when-issued-from-robot-framework/2968>\
**Category:** Robot Framework\
**Created:** [18 December 2021 18:27 UTC](https://forum.robotframework.org/t/process-call-fails-when-issued-from-robot-framework/2968 "2021-12-18T18:27:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divakar58](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@Divakar58](https://forum.robotframework.org/u/Divakar58)\
**Post date:** [18 December 2021 18:27 UTC](https://forum.robotframework.org/t/process-call-fails-when-issued-from-robot-framework/2968/1 "2021-12-18T18:27:57Z")

</div>

I’ve noticed following behavior:

```
    os.dup2(tee.stdin.fileno(), sys.stdout.fileno())
    os.dup2(tee.stdin.fileno(), sys.stderr.fileno())

```

Works fine when directly executed via python, but when command is issued via robot framework subprocess starts to yield an error:  
XX.robot`

Traceback (most recent call last):  
File “/usr/lib/python3.8/threading.py”, line 932, in \_bootstrap\_inner  
self.run()  
File “/home/tmp/Trace/TracieThread.py”, line 33, in run  
os.dup2(tee.stdin.fileno(), sys.stdout.fileno())  
io.UnsupportedOperation: fileno

---

<div class="post-metadata">

**Author:** ![pekkaklarck](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/pekkaklarck/32/1019_2.png) [@pekkaklarck](https://forum.robotframework.org/u/pekkaklarck)\
**Post date:** [18 December 2021 21:00 UTC](https://forum.robotframework.org/t/process-call-fails-when-issued-from-robot-framework/2968/2 "2021-12-18T21:00:33Z")

</div>

Robot intercepts `sys.stdout` and `sys.stderr` so that they are replaced with `StringIO` objects. If you need to access original streams, use `sys. __stdout__ ` and `sys. __stderr__ `.

---

<div class="post-metadata">

**Author:** ![Divakar58](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@Divakar58](https://forum.robotframework.org/u/Divakar58)\
**Post date:** [19 December 2021 10:34 UTC](https://forum.robotframework.org/t/process-call-fails-when-issued-from-robot-framework/2968/3 "2021-12-19T10:34:11Z")

</div>

It works. Thank you.
