Source: bpython
Severity: normal

Dear Maintainer,

running bpython(3) inside a minimal installation and trying to read the
help of some module or function results in an ``OSError: [Errno 2] No
such file or directory`` | ``FileNotFoundError: [Errno 2] No such file
or directory: 'less'`` (python 2 or 3 respectively) because the pager of
choice (which seems to be less) can't be found.

Manually installing less results in the correct behaviour.

I agree that running bpython(3) on a system where less is not installed
is a niche case (it took me years of using bpython before I ever met
this issue), but I think that less should be added to the Recommends: of
both bpython and bpython3, as I consider reading help quite a common
activity inside an interactive interpreter. (not a Depends:, as it isn't
required for basic functionality, however).

To reproduce:

* debootstrap a chroot, forget to install basic tools such as less :)
* install bpython or bpython3 inside the chroot and run it::

    >>> import this
    [...]
    >>> help(this)
    Traceback (most recent call last):
      File "<input>", line 1, in <module>
        help(this)
      File 
"/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/_internal.py", l
    ine 60, in __call__                                                         
   
        return super(_Helper, self).__call__(*args, **kwargs)
      File "/usr/lib/python3/dist-packages/bpython/_internal.py", line 24, in 
__call
    __                                                                          
   
        self.helper(*args, **kwargs)
      File "/usr/lib/python3.5/pydoc.py", line 1853, in __call__
        self.help(request)                                      
      File "/usr/lib/python3.5/pydoc.py", line 1906, in help
        else: doc(request, 'Help on %s:', output=self._output)
      File "/usr/lib/python3.5/pydoc.py", line 1640, in doc   
        pager(render_doc(thing, title, forceload))         
      File 
"/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/_internal.py", l
    ine 53, in pager                                                            
   
        self._repl.pager(output)
      File "/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/repl.py", 
line 1
    699, in pager                                                               
   
        self.focus_on_subprocess(command + [tmp.name])
      File "/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/repl.py", 
line 1
    684, in focus_on_subprocess                                                 
   
        stdout=sys.__stdout__) 
      File "/usr/lib/python3.5/subprocess.py", line 676, in __init__
        restore_signals, start_new_session)                         
      File "/usr/lib/python3.5/subprocess.py", line 1282, in _execute_child
        raise child_exception_type(errno_num, err_msg)                     
    FileNotFoundError: [Errno 2] No such file or directory: 'less'

Thanks for your job maintaining bpython

Reply via email to