Skip to content

Commit

Permalink
pyln: Do not rstrip() the return value of .append()
Browse files Browse the repository at this point in the history
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()`
  • Loading branch information
cdecker committed Dec 18, 2020
1 parent e736463 commit 0257a5d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contrib/pyln-testing/pyln/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,13 @@ def tail(self):

if self.proc.stderr:
for line in iter(self.proc.stderr.readline, ''):

if line is None or len(line) == 0:
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()

def is_in_log(self, regex, start=0):
Expand Down

0 comments on commit 0257a5d

Please sign in to comment.