• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

containerbuildsystem / osbs-client / 5172
84%

Build:
DEFAULT BRANCH: master
Ran 02 Oct 2020 02:08PM UTC
Jobs 8
Files 25
Run time 5min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
5172

push

travis-ci

MartinBasti
HttpStream: fix close method

`.close()` is called from `__del__` and because this happend during
garbage collecting nothing is guaranted [1] and it results into following
traceback printed directly to stderr because it happened in GC context:
```
Traceback (most recent call last):
  File "/home/mbasti/repos-upstream/osbs-client/osbs/http.py", line 221, in __del__
    self.close()
  File "/home/mbasti/repos-upstream/osbs-client/osbs/http.py", line 214, in close
    if not self.closed:
AttributeError: 'HttpStream' object has no attribute 'closed'
```

Using getattr instead to avoid traceback.

TLDR: use context managers if you want to be sure that connection is closed
properly.

[1] https://docs.python.org/3/reference/datamodel.html#object.__del__

Signed-off-by: Martin Bašti <mbasti@redhat.com>

3555 of 4267 relevant lines covered (83.31%)

2.49 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5172.1 (ACTION=bandit OS=centos OS_VERSION=7 PYTHON_VERSION=2 ENGINE=docker) 02 Oct 2020 02:08PM UTC 0
0.0
Travis Job 5172.1
2 5172.2 (ACTION=bandit OS=fedora OS_VERSION=31 PYTHON_VERSION=3 ENGINE=docker) 02 Oct 2020 02:08PM UTC 0
0.0
Travis Job 5172.2
3 5172.3 (ACTION=pylint OS=fedora OS_VERSION=29 PYTHON_VERSION=2 ENGINE=docker) 02 Oct 2020 02:09PM UTC 0
0.0
Travis Job 5172.3
4 5172.4 (ACTION=pylint OS=fedora OS_VERSION=31 PYTHON_VERSION=3 ENGINE=docker) 02 Oct 2020 02:09PM UTC 0
0.0
Travis Job 5172.4
5 5172.5 (OS=centos OS_VERSION=7 PYTHON_VERSION=2 ENGINE=docker) 02 Oct 2020 02:11PM UTC 0
83.15
Travis Job 5172.5
6 5172.6 (OS=fedora OS_VERSION=30 PYTHON_VERSION=3 ENGINE=docker) 02 Oct 2020 02:12PM UTC 0
83.1
Travis Job 5172.6
7 5172.7 (OS=fedora OS_VERSION=31 PYTHON_VERSION=3 ENGINE=docker) 02 Oct 2020 02:13PM UTC 0
83.06
Travis Job 5172.7
8 5172.8 (ACTION=markdownlint ENGINE=docker) 02 Oct 2020 02:10PM UTC 0
0.0
Travis Job 5172.8
Source Files on build 5172
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #5172
  • f21f4071 on github
  • Prev Build on master (#5156)
  • Next Build on master (#5173)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc