You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UploadSourceStream opens a stream to compute its SHA1 and never closes it #653
When the checksum or length of a stream-based upload source is needed, hex_sha1_of_unlimited_stream(self.open()) is called on a stream that is never closed. On CPython the object is usually closed promptly by reference counting, but on other runtimes or with custom stream openers the handle can stay open.
Where
b2sdk/_internal/transfer/outbound/upload_source.py:318-321 (_set_content_length_and_sha1, line 319).
Why it matters
Impact: Left behind (resource not released), silent. Severity: Low, because on CPython the stream is normally released straight away, so no concrete leak is shown.
How to check
Use a stream_opener that returns a stream recording close() calls, request get_content_sha1(), and check that close() is not called. Found by reading the code, not reproduced.
Version
Seen at v2.13.4. Present on the default branch: present.
Activity