Skip to content

Fix #485, download Zhang files without requiring Content-Length - #494

Open
sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-485-download-without-content-length
Open

Fix #485, download Zhang files without requiring Content-Length#494
sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-485-download-without-content-length

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #485.

Use the streamed GET response for optional download-size metadata instead of requiring a HEAD Content-Length. Share the transport between the Zhang database and LUT downloads, tolerate absent/invalid sizes, and close network/progress resources on every exit.

Stage downloads beside the destination and publish only after the existing checksum matches. Interrupted, HTTP-failed, or checksum-failed downloads now leave existing files intact and remove their temporary file; checksum failures no longer leave an invalid database installed.

Validation

macOS arm64, Python 3.12.11:

  • python -m unittest Tests.test_filing -v: 12 tests passed, exercising both public download functions.
  • Includes a real localhost HTTP redirect followed by a chunked response without Content-Length, with real checksum verification.
  • Failure cases cover HTTP/connection errors, interrupted transfers, checksum mismatch, output-file errors, and cancellation.
  • Both public downloaders reproduced the original KeyError before the fix.
  • Syntax/error checks, bytecode compilation, and git diff --check passed.

Add the offline suite to Application Testing before the existing sample-data tests. Full sensor processing, live multi-gigabyte downloads, and Windows/Linux execution were not run.

Contributor: Sylvester Kaczmarek, Personal. No third-party code added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant