Browse Source

pyln: Do not rstrip() the return value of .append()

This was causing the following error

```
Exception in thread Thread-553:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/tmp/cirrus-ci-build/contrib/pyln-testing/pyln/testing/utils.py", line 232, in tail
    self.err_logs.append(line.rstrip().decode('UTF-8', 'replace')).rstrip()
AttributeError: 'NoneType' object has no attribute 'rstrip'

[gw5] [ 33%] FAILED tests/test_misc.py::test_bitcoin_failure
```

Notice the second call to `.rstrip()` on the return value of `.append()`
ppa
Christian Decker 4 years ago
parent
commit
dbb83a1bc3
  1. 6
      contrib/pyln-testing/pyln/testing/utils.py

6
contrib/pyln-testing/pyln/testing/utils.py

@ -227,9 +227,13 @@ class TailableProc(object):
if self.proc.stderr: if self.proc.stderr:
for line in iter(self.proc.stderr.readline, ''): for line in iter(self.proc.stderr.readline, ''):
if line is None or len(line) == 0: if line is None or len(line) == 0:
break break
self.err_logs.append(line.rstrip().decode('UTF-8', 'replace')).rstrip()
line = line.rstrip().decode('UTF-8', 'replace')
self.err_logs.append(line)
self.proc.stderr.close() self.proc.stderr.close()
def is_in_log(self, regex, start=0): def is_in_log(self, regex, start=0):

Loading…
Cancel
Save