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

Unable to use a pager #4

Closed
pmopmo opened this issue Feb 25, 2022 · 1 comment
Closed

Unable to use a pager #4

pmopmo opened this issue Feb 25, 2022 · 1 comment

Comments

@pmopmo
Copy link

pmopmo commented Feb 25, 2022

It's not possible to pipe output of fetch to a file or a pager

fetch -i mallard | less -R

Traceback (most recent call last):
  File "/usr/local/bin/fetch", line 11, in <module>
    load_entry_point('yashsinghcodes==0.1', 'console_scripts', 'fetch')()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2700, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2318, in load
    return self.resolve()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "/usr/local/lib/python3.6/site-packages/yashsinghcodes-0.1-py3.6.egg/fetch/__init__.py", line 4, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "/usr/local/lib/python3.6/site-packages/yashsinghcodes-0.1-py3.6.egg/fetch/fetch.py", line 3, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "/usr/local/lib/python3.6/site-packages/yashsinghcodes-0.1-py3.6.egg/fetch/info.py", line 18, in <module>
OSError: [Errno 25] Inappropriate ioctl for device

In fetch/info.py I changed

width,height = os.get_terminal_size()

to

try:
    width,height = os.get_terminal_size()
except OSError:
    width = 120
    height = 80

to get it to work

@yashsinghcodes
Copy link
Owner

Thanks for reporting the issue. I have used your quick fix for OSError and will look deep in the issue for some better fix.

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

No branches or pull requests

2 participants