amitt001 / amitt001/delegator.py

Error getting subprocess error with non-blocking mode

Aperta
#54 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
1.7k
Fork
86
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Accessing `command.err` a second time causes an exception

```
In [1]: import delegator

In [2]: command = delegator.run('echo a', block=False)

In [3]: command.err
Out[3]: 'a\n'

In [4]: command.err
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
----> 1 command.err

~/.virtualenvs/service-mailer/lib/python3.6/site-packages/delegator.py in err(self)
114 return self.__err
115 else:
--> 116 return self._pexpect_out
117
118 @property

~/.virtualenvs/service-mailer/lib/python3.6/site-packages/delegator.py in _pexpect_out(self)
82 result += self.subprocess.before
83 if self.subprocess.after:
---> 84 result += self.subprocess.after
85
86 result += self.subprocess.read()

TypeError: must be str, not type
```

The cause is that `self.subprocess.after` becomes `` after the first `command.err`

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.