Repository navigation
Restore the Flickr image downloader on Python 3 - #4977
Merged
Merged
Conversation
Add tests for retrying parse_page after a TimeoutError, returning the empty result after repeated timeouts, and closing the HTTP response. Restore the executable bit on flickr_downloader.py that was dropped in the Python 3 migration.
ahojnnes
approved these changes
Nov 8, 2026
ahojnnes
enabled auto-merge (squash)
November 8, 2026 17:22
fringehush-gif
added a commit
to fringehush-gif/colmap
that referenced
this pull request
Nov 8, 2026
Merge the upstream Flickr downloader repair into the user fork. The downloader uses Python 3 urllib modules and closes parsed responses. ## Upstream commits - Merge upstream 9f0736e, Restore the Flickr image downloader on Python 3 (colmap#4977). ## Validation - Python 3.12.14: all three upstream mocked regression functions passed by direct invocation, with a temporary directory supplied for the one fixture. The retained interpreter has no pytest module, so pytest collection was not run. - No live network requests; mocked tests cover parsed response, image retrieval arguments, timeout retry and exhausted retries. No C++ rebuild was performed. AI disclosure: Totally vibe coded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dataset downloader imports
urllib2andurlparse, so loading the script on Python 3 raisesModuleNotFoundErrorbefore the CLI can parse any options. Use the standardurllib.requestandurllib.parsemodules and close the HTTP response after parsing the XML page.The regression test reads a Flickr-shaped XML response and checks the image URL and local filename passed to the retriever, including a URL with a query string. Network access is mocked. Verified
python python/util/flickr_downloader.py --helpandpytest python/util/flickr_downloader_test.pyon Python 3.12. Ruff lint and format checks pass.