Package: trash-cli
Version: 0.1.10.28-2
Followup-For: Bug #493212
I've also experienced this problem. I've fixed it using the attached patch,
which treats leading whitespace as an indicator the the previous line of
output from df is being continued.
-- System Information:
Debian Release: 5.0.2
APT prefers stable
APT policy: (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.30-bpo.1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages trash-cli depends on:
ii python 2.5.2-3 An interactive high-level object-o
ii python-support 0.8.4 automated rebuilding support for P
trash-cli recommends no packages.
trash-cli suggests no packages.
-- no debconf information
--- /usr/share/python-support/trash-cli/libtrash.py 2008-06-21
07:48:52.000000000 -0400
+++ libtrash.py 2009-07-06 09:20:46.645855220 -0400
@@ -459,18 +459,26 @@
mount_list.append(mount)
else:
+ extra = []
df_file=os.popen('df')
while True:
df_list=df_file.readline()
if not df_list:
break #EOF
+ # join lines that got wrapped
+ if extra:
+ df_list = extra + ' ' + df_list
dflistlower = df_list.lower()
if 'filesystem' in dflistlower:
continue
if 'proc' in dflistlower:
continue
-
-
file_sys,disc_size,disc_used,disc_avail,disc_cap_pct,mount=df_list.split()
+ try:
+
file_sys,disc_size,disc_used,disc_avail,disc_cap_pct,mount=df_list.split()
+ extra = []
+ # catch wrapped lines
+ except ValueError, e:
+ extra = df_list.rstrip()
mount_list.append(mount)
return (mount_list)