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

fix/urgent: downloads not working if no terminal attached #2564

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

Kinsteen
Copy link
Contributor

Description

This fixes the issue where downloads are not working from the app.

shutil.get_terminal_size() will never raise an exception. If no terminal is used, then it will fallback to a size of (80, 24) per default, which will fix the problem as os.get_terminal_size() raises an exception if there is no terminal.

Fixes a lot of issues

NOTE: should be merged ASAP and released, as downloads being not available from the app is quite blocking.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.

  • locally

@github-actions
Copy link
Contributor

Pylint result on modfied files:
------------- Module bottles.backend.downloader
bottles/backend/downloader.py:20:0: E0401: Unable to import 'requests' (import-error)
bottles/backend/downloader.py:21:0: E0401: Unable to import 'gi.repository' (import-error)
bottles/backend/downloader.py:103:29: C0321: More than one statement on a single line (multiple-statements)
bottles/backend/downloader.py:30:0: R0903: Too few public methods (1/2) (too-few-public-methods)
bottles/backend/downloader.py:30:0: W0612: Unused variable 'Downloader' (unused-variable)

Your code has been rated at 8.03/10

@Kinsteen Kinsteen changed the base branch from main to 50.2 January 18, 2023 09:30
@Kinsteen Kinsteen changed the base branch from 50.2 to main January 18, 2023 09:45
@Kinsteen Kinsteen merged commit c40eff3 into bottlesdevs:main Jan 18, 2023
@Kinsteen Kinsteen deleted the fix-downloads branch January 18, 2023 14:55
Kinsteen added a commit to Kinsteen/Bottles that referenced this pull request Jan 18, 2023
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