Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading Fenix build with invalid platform raises an index error #664

Open
whimboo opened this issue Mar 26, 2024 · 1 comment · Fixed by #672
Open

Downloading Fenix build with invalid platform raises an index error #664

whimboo opened this issue Mar 26, 2024 · 1 comment · Fixed by #672

Comments

@whimboo
Copy link
Contributor

whimboo commented Mar 26, 2024

Using the following arguments from a non Android platform causes the code in DailyScraper to fail with an IndexError because there is no such build for such a platform.

mozdownload -a fenix -t daily -p mac

Traceback (most recent call last):
  File "/Users/henrik/code/mozdownload/venv/bin/mozdownload", line 33, in <module>
    sys.exit(load_entry_point('mozdownload', 'console_scripts', 'mozdownload')())
  File "/Users/henrik/code/mozdownload/mozdownload/cli.py", line 169, in cli
    build = factory.FactoryScraper(scraper_type, **kwargs)
  File "/Users/henrik/code/mozdownload/mozdownload/factory.py", line 126, in __init__
    scraper_types[scraper_type].__init__(self, **kwargs)
  File "/Users/henrik/code/mozdownload/mozdownload/scraper.py", line 383, in __init__
    Scraper.__init__(self, *args, **kwargs)
  File "/Users/henrik/code/mozdownload/mozdownload/scraper.py", line 165, in __init__
    self._retry_check_404(self.get_build_info)
  File "/Users/henrik/code/mozdownload/mozdownload/scraper.py", line 180, in _retry_check_404
    self._retry(func, **retry_kwargs)
  File "/Users/henrik/code/mozdownload/mozdownload/scraper.py", line 171, in _retry
    return redo.retry(func, **retry_kwargs)
  File "/Users/henrik/code/mozdownload/venv/lib/python3.10/site-packages/redo-2.0.4-py3.10.egg/redo/__init__.py", line 170, in retry
    return action(*args, **kwargs)
  File "/Users/henrik/code/mozdownload/mozdownload/scraper.py", line 434, in get_build_info
    self.date = self.get_latest_build_date()
  File "/Users/henrik/code/mozdownload/mozdownload/scraper.py", line 456, in get_latest_build_date
    date = ''.join(parser.entries[-1].split('-')[:6])
IndexError: list index out of range
@whimboo whimboo added this to the 1.29.0 milestone Mar 26, 2024
piri-p added a commit to piri-p/mozdownload that referenced this issue Apr 28, 2024
piri-p added a commit to piri-p/mozdownload that referenced this issue May 2, 2024
piri-p added a commit to piri-p/mozdownload that referenced this issue May 2, 2024
piri-p added a commit to piri-p/mozdownload that referenced this issue May 6, 2024
piri-p added a commit to piri-p/mozdownload that referenced this issue May 6, 2024
@whimboo whimboo reopened this May 6, 2024
@whimboo
Copy link
Contributor Author

whimboo commented May 6, 2024

PR #672 fixed only one case but we should still check early when checking command line arguments if the given platform is supported by the application.

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

Successfully merging a pull request may close this issue.

1 participant