On 11/8/06, Mark Sapiro <[EMAIL PROTECTED]> wrote: > Lukasz Szybalski wrote: > > > >I put the original smtplib.py file back in /varlib/python.3/smtplib.py > >and i get the same problem again. > > > >Nov 08 16:41:31 2006 (13973) Low level smtp error: [Errno 9] Bad file > >descriptor, msgid: > ><[EMAIL PROTECTED]> > >Nov 08 16:46:31 2006 (13973) delivery to [EMAIL PROTECTED] failed with > >code -1: [Errno 9] Bad file descriptor > >Nov 08 16:46:31 2006 (13973) Low level smtp error: [Errno 9] Bad file > >descriptor, msgid: <[EMAIL PROTECTED]> > >Nov 08 16:46:31 2006 (13973) delivery to [EMAIL PROTECTED] failed with > >code -1: [Errno 9] Bad file descriptor > > > >So i guess i will stick with the file i got from debian bug > > > Please post a 'diff -u' between the smtplib.py that works and the one > that doesn't work. > > Lionel says that effectively all he changed in your working version was > writing debug output to sys.stderr instead of stdout, and when I > diffed Lionel's version with the Python 2.3.4 base, that's the only > change I saw, but there must be something else in your case or else > simply enabling the debug prints causes the problem because of the > writes to stdout, but then what caused the original problem. > > In any case, I am very interested to see if there is some other change > in your original smtplib.py that is causing it to fail. >
Please not the smtlib.py is the one given to me and smtlib.py.1 is the original one causing the problem. I posted the whole file to debian bug report also. [EMAIL PROTECTED]:/usr/lib/python2.3$ diff -u smtplib.py smtplib.py.1 --- smtplib.py 2006-11-03 11:35:49.000000000 -0600 +++ smtplib.py.1 2006-11-03 12:41:55.000000000 -0600 @@ -41,7 +41,6 @@ # # This was modified from the Python 1.5 library HTTP lib. -import sys import socket import re import rfc822 @@ -283,17 +282,17 @@ except ValueError: raise socket.error, "nonnumeric port" if not port: port = SMTP_PORT - if self.debuglevel > 0: print >> sys.stderr, 'connect:', (host, port) + if self.debuglevel > 0: print 'connect:', (host, port) msg = "getaddrinfo returns an empty list" self.sock = None for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res try: self.sock = socket.socket(af, socktype, proto) - if self.debuglevel > 0: print >> sys.stderr, 'connect:', (host, port) + if self.debuglevel > 0: print 'connect:', (host, port) self.sock.connect(sa) except socket.error, msg: - if self.debuglevel > 0: print >> sys.stderr, 'connect fail:', (host, port) + if self.debuglevel > 0: print 'connect fail:', (host, port) if self.sock: self.sock.close() self.sock = None @@ -302,12 +301,12 @@ if not self.sock: raise socket.error, msg (code, msg) = self.getreply() - if self.debuglevel > 0: print >> sys.stderr, "connect:", msg + if self.debuglevel > 0: print "connect:", msg return (code, msg) def send(self, str): """Send `str' to the server.""" - if self.debuglevel > 0: print >> sys.stderr, 'send:', `str` + if self.debuglevel > 0: print 'send:', `str` if self.sock: try: self.sock.sendall(str) @@ -346,7 +345,7 @@ if line == '': self.close() raise SMTPServerDisconnected("Connection unexpectedly closed") - if self.debuglevel > 0: print >> sys.stderr, 'reply:', `line` + if self.debuglevel > 0: print 'reply:', `line` resp.append(line[4:].strip()) code=line[:3] # Check that the error code is syntactically correct. @@ -362,7 +361,7 @@ errmsg = "\n".join(resp) if self.debuglevel > 0: - print >> sys.stderr, 'reply: retcode (%s); Msg: %s' % (errcode,errmsg) + print 'reply: retcode (%s); Msg: %s' % (errcode,errmsg) return errcode, errmsg def docmd(self, cmd, args=""): @@ -475,7 +474,7 @@ """ self.putcmd("data") (code,repl)=self.getreply() - if self.debuglevel >0 : print >> sys.stderr, "data:", (code,repl) + if self.debuglevel >0 : print "data:", (code,repl) if code != 354: raise SMTPDataError(code,repl) else: @@ -485,7 +484,7 @@ q = q + "." + CRLF self.send(q) (code,msg)=self.getreply() - if self.debuglevel >0 : print >> sys.stderr, "data:", (code,msg) + if self.debuglevel >0 : print "data:", (code,msg) return (code,msg) def verify(self, address): [EMAIL PROTECTED]:/usr/lib/python2.3$ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=395493 -- Universal Information Crawler http://uicrawler.sourceforge.net/ ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp