Lightmatter / welkin-health

A Python wrapper of the Welkin Health API
https://welkin.readthedocs.io
Other
4 stars 3 forks source link

Reset file offsets before sending a request #115

Closed samamorgan closed 3 months ago

samamorgan commented 3 months ago

With our request retry mechanism on HTTP 401 responses, the follow-up request that contains files to be uploaded will fail because the file has already been read by Requests to determine the file size.

This patch ensures that all files passed into a request are at offset 0 before sending the request.

github-actions[bot] commented 3 months ago

Coverage

Coverage Report (Python 3.8) •
FileStmtsMissCoverMissing
welkin
   client.py132993%181, 225–229, 242, 276, 288
   util.py111199%142
TOTAL10224895% 

Tests Skipped Failures Errors Time
230 3 :zzz: 0 :x: 0 :fire: 3.362s :stopwatch:
github-actions[bot] commented 3 months ago

Coverage

Coverage Report (Python 3.10) •
FileStmtsMissCoverMissing
welkin
   client.py132993%181, 225–229, 242, 276, 288
   util.py111199%142
TOTAL10224895% 

Tests Skipped Failures Errors Time
230 3 :zzz: 0 :x: 0 :fire: 3.431s :stopwatch:
github-actions[bot] commented 3 months ago

Coverage

Coverage Report (Python 3.9) •
FileStmtsMissCoverMissing
welkin
   client.py132993%181, 225–229, 242, 276, 288
   util.py111199%142
TOTAL10224895% 

Tests Skipped Failures Errors Time
230 3 :zzz: 0 :x: 0 :fire: 3.542s :stopwatch:
github-actions[bot] commented 3 months ago

Coverage

Coverage Report (Python 3.11) •
FileStmtsMissCoverMissing
welkin
   client.py132993%181, 225–229, 242, 276, 288
   util.py111199%142
TOTAL10224895% 

Tests Skipped Failures Errors Time
230 3 :zzz: 0 :x: 0 :fire: 3.327s :stopwatch:
github-actions[bot] commented 3 months ago

Coverage

Coverage Report (Python 3.12) •
FileStmtsMissCoverMissing
welkin
   client.py132993%181, 225–229, 242, 276, 288
   util.py111199%142
TOTAL10224895% 

Tests Skipped Failures Errors Time
230 3 :zzz: 0 :x: 0 :fire: 4.132s :stopwatch: