Package: freeloader
Version: 0.3-3
Severity: normal
Tags: patch

I got an exception when exiting freeloader :

[EMAIL PROTECTED]:~$ freeloader
Exception in thread Thread-1:Traceback (most recent call last):
  File "/usr/lib/python2.3/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/share/freeloader/sockdae.py", line 116, in run
    self.sock.shutdown(socket.SHUT_RDWR)
AttributeError: 'module' object has no attribute 'SHUT_RDWR'


It appears that SHUT_RDWR doesn't exist in Python 2.3. Instead, it should try 
to use socket.SHUT_RDWR and fallback to 2 if it
can't. See attached file for a dirty fix (there may be better solution).


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-2-amd64-k8
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages freeloader depends on:
ii  bittorrent                    3.4.2-6    Scatter-gather network file transf
ii  librsvg2-2                    2.9.5-6    SAX-based renderer library for SVG
ii  python                        2.3.5-3    An interactive high-level object-o
ii  python-glade2                 2.6.3-2    GTK+ bindings: Glade support
ii  python-gnome2                 2.10.0-4   Python bindings for the GNOME desk
ii  python-gtk2                   2.6.3-2    Python bindings for the GTK+ widge

Versions of packages freeloader recommends:
pn  python-gamin                  <none>     (no description available)
ii  python-gnome2-extras          2.10.2-1   Python bindings for the GNOME desk

-- no debconf information

*** sockdae.py.patch
--- /usr/share/freeloader/sockdae.py    2005-12-29 15:46:43.000000000 +0100
+++ sockdae.py  2005-12-29 20:44:45.000000000 +0100
@@ -83,18 +83,23 @@
                                if self.killflag.isSet():
                                        break
                                continue
-
+                       
+                       try:
+                               shutdown_value = socket.SHUT_RDWR
+                       except AttributeError:
+                               shutdown_value = 2 # python2.3 fix
+                       
                        key = self.read_expected(c, 5)
                        flags = self.read_expected(c, 10)
                        count = self.parse_flags(flags)
                        if count > 0:
-                               c.shutdown(socket.SHUT_RDWR)
+                               c.shutdown(shutdown_value)
                                c.close()
                                continue
 
                        if cmp(key,self.key) != 0:
                                print "Ineligible connection with key " + key
-                               c.shutdown(socket.SHUT_RDWR)
+                               c.shutdown(shutdown_value)
                                c.close()
                        else:
                                f = c.recv(1024)
@@ -108,12 +113,12 @@
                                        except:
                                                break;
 
-                               c.shutdown(socket.SHUT_RDWR)
+                               c.shutdown(shutdown_value)
                                c.close()
 
                                self.handle_file(file)
 
-               self.sock.shutdown(socket.SHUT_RDWR)
+               self.sock.shutdown(shutdown_value)
                self.sock.close()
 
        def handle_file(self, uri):


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to