Package: lfm
Version: 2.3-1
Severity: important
Tags: patch

Dear Maintainer,


Right after installing lfm,  
I try to run the program
      * What was the outcome of this action?
a crash::  
fp2x@drmas:~$ lfm -1
Traceback (most recent call last):
  File "/usr/bin/lfm", line 27, in <module>
    lfm_start(sys.argv)
  File "/usr/share/lfm/lfm/lfm.py", line 1155, in lfm_start
    path = curses.wrapper(main, prefs, paths1, paths2)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/share/lfm/lfm/lfm.py", line 1077, in main
    ret = app.run()
  File "/usr/share/lfm/lfm/lfm.py", line 209, in run
    ret = self.act_pane.manage_keys()
  File "/usr/share/lfm/lfm/lfm.py", line 810, in manage_keys
    self.app.half_display()
  File "/usr/share/lfm/lfm/lfm.py", line 170, in half_display
    self.act_pane.display()
  File "/usr/share/lfm/lfm/lfm.py", line 592, in display
    self.display_cursorbar()
  File "/usr/share/lfm/lfm/lfm.py", line 761, in display_cursorbar
    cursorbar.addstr(0, 0, utils.encode(buf), attr)
_curses.error: addstr() returned ERR

   * What outcome did you expect instead?
A display of files and directories in $HOME.

This bug was reported as #879670 on launchpad 
      https://bugs.launchpad.net/ubuntu/+source/lfm/+bug/879670
  
After investigating the error message (.error: addstr() returned ERR),
I changed a number of (cwindow).addstr( ) methods to .insstr( )
  calls, in order to avoid the crash (the Addstr() method tries to scroll
the window after inserting the contents. This scrolling does not occur
with .insstr() according to some curses users.

In the attached patch I have not changed all the addstr() calls to
insstr() calls.

There is also a minor packaging bug : lfm should not depend on
python-support. Due to this bug, if we run

fp2x@drmas:~$ python
Python 2.7.9 (default, Mar  1 2015, 12:57:24)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import lfm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named lfm
>>>

So the code part of /usr/bin/lfm  ... :

import sys
from lfm.lfm import lfm_start

if sys.version_info < (2, 5): 
      print "Python 2.5 or higher is required to run lfm."
else: 
         lfm_start(sys.argv)


...    cannot be tested interactively.


-- System Information:
Debian Release: 8.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages lfm depends on:
ii  python          2.7.9-1
ii  python-support  1.0.15

lfm recommends no packages.





Sorry for the inlined headers, as I have to copy and paste the reportbug 
outpit into a very Linux fiendly system (IBM Notes 9 on a windows 7 
Professional 32 bits platform).

Cordialement,
Regards,
Mit freundlichen Grüßen,
مع  تحياتي الخالصة  
---
F. Petitjean
Bureau Veritas

Département Recherche, le département de l'excellence technique

Comme le disait Alan J. Perlis en 1982 :
It is easier to write an incorrect program than understand a correct one.

This message contains confidential information. 
To know more, please click on the following link: 
http://disclaimer.bureauveritas.com

Attachment: lfm.patch
Description: Binary data

Reply via email to