#60 [PATCH] _get_file: add wget fallback
Closed: Invalid None Opened 11 years ago by salimma.

The requests library used in the current development version of
FedoraReview only supports HTTP and HTTPS URL schemas, whereas download
URLs could potentially be FTP as well.

This patch makes _get_file first check if the current requested URL's
schema is supported by requests, and if not, revert to the old wget
download code.

ps how does one apply for commit access? This seems like a project I'd be using more in the future, and I do package reviews with aspects that are not currently supported very well (e.g. github-style download URLs, esoteric programming languages). Thanks!


Patch against current git head to provide alternative download mechanism
0001-_get_file-add-wget-fallback.patch

Tested with review # 829528 which uses FTP for both spec and URL (submitter is old school - he's a NetBSD developer as well)

Thanks for the patch, but two things:

  • I prefer that we don't use call directly, but I see it elsewhere in the code, so I guess it is ok (or we should change it everywhere).
  • Actually if requests doesn't really do the job then I'd be in favour of going back to urllib which supports http and ftp as far as I know and is a full python solution.

It occurred to me that urllib is a better solution as well, but thought it's more acceptable to just revert to the previous solution.

It seems that even fedora-review 0.1.0 uses wget -- would you accept a patch that use urllib? or is it easier right now to just revert the switch to the requests module?

Current code uses urllib. I want to close this bug as 'worksforme', but would be happy if someone provided a test case (i. e., bugzilla bug) with ftp url:s to verify. Anyone, out there?

EDIT: read whole bug first. Will try with 829528.

BUg 829528 works find with current code @b3a133e. Closing as WONTFIX. the patch is just not needed. Thanks for the input and also the testcase! Please feel free to reopen bug if required.

Login to comment on this ticket.

Metadata