Skip to content

Restore the Flickr image downloader on Python 3 - #4977

Merged
ahojnnes merged 2 commits into
colmap:mainfrom
Afloat16:python3-flickr-dataset-download
Nov 8, 2026
Merged

ahojnnes merged 2 commits into
colmap:mainfrom
Afloat16:python3-flickr-dataset-download

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

The dataset downloader imports urllib2 and urlparse, so loading the script on Python 3 raises ModuleNotFoundError before the CLI can parse any options. Use the standard urllib.request and urllib.parse modules 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 --help and pytest python/util/flickr_downloader_test.py on Python 3.12. Ruff lint and format checks pass.

Afloat16 and others added 2 commits November 7, 2026 02:39
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 ahojnnes added the full-ci Run Windows and remaining pycolmap CI label Nov 8, 2026
@ahojnnes
ahojnnes enabled auto-merge (squash) November 8, 2026 17:22
@ahojnnes
ahojnnes merged commit 9f0736e into colmap:main Nov 8, 2026
18 of 21 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Run Windows and remaining pycolmap CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants