From 6d1d3e8938da4858b05f6e7035674e8a73744fd7 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 15 Nov 2001 10:24:27 +0000 Subject: [PATCH] handle the case where there is no file attached git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@402 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 6 ++++++ roundup/cgi_client.py | 18 +++++++++++------- roundup/mailgw.py | 7 +++++-- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 413f268..928c7e9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -34,11 +34,17 @@ Fixed: . bug #479511 ] mailgw to pop . bug #479508 ] roundup-admin crash on wrong class . bad error report in hyperdb + . roundup.mailgw now handles errors on the set() and create() at the end + of processing + . roundup.mailgw also handles messages that are passed to it that don't + contain a From: line - apparently some POP servers can do this. It punts + an error message to the roundup admin. . fixed nosy reaction and author copy handling . errors in nosy reaction will be propogated now (were effectively being squashed) . re-open the database as the author in mail handling + 2001-10-23 - 0.3.0 pre 3 Feature: . MailGW now moves 'unread' to 'chatting' on receiving e-mail for an issue. diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py index e05aa1a..24ff631 100644 --- a/roundup/cgi_client.py +++ b/roundup/cgi_client.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: cgi_client.py,v 1.56 2001-11-14 21:35:21 richard Exp $ +# $Id: cgi_client.py,v 1.57 2001-11-15 10:24:27 richard Exp $ import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes import binascii, Cookie, time @@ -428,12 +428,13 @@ class Client: files = [] if self.form.has_key('__file'): file = self.form['__file'] - type = mimetypes.guess_type(file.filename)[0] - if not type: - type = "application/octet-stream" - # create the new file entry - files.append(self.db.file.create(type=type, name=file.filename, - content=file.file.read())) + if file.filename: + type = mimetypes.guess_type(file.filename)[0] + if not type: + type = "application/octet-stream" + # create the new file entry + files.append(self.db.file.create(type=type, name=file.filename, + content=file.file.read())) # generate an edit message # don't bother if there's no messages or nosy list @@ -966,6 +967,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0): # # $Log: not supported by cvs2svn $ +# Revision 1.56 2001/11/14 21:35:21 richard +# . users may attach files to issues (and support in ext) through the web now +# # Revision 1.55 2001/11/07 02:34:06 jhermann # Handling of damaged login cookies # diff --git a/roundup/mailgw.py b/roundup/mailgw.py index fa144f6..e0b3ce5 100644 --- a/roundup/mailgw.py +++ b/roundup/mailgw.py @@ -72,7 +72,7 @@ are calling the create() method to create a new node). If an auditor raises an exception, the original message is bounced back to the sender with the explanatory message given in the exception. -$Id: mailgw.py,v 1.33 2001-11-13 21:44:44 richard Exp $ +$Id: mailgw.py,v 1.34 2001-11-15 10:24:27 richard Exp $ ''' @@ -126,7 +126,7 @@ class MailGW: def handle_Message(self, message): '''Handle an RFC822 Message - Hanle the Message object by calling handle_message() and then cope + Handle the Message object by calling handle_message() and then cope with any errors raised by handle_message. This method's job is to make that call and handle any errors in a sane manner. It should be replaced if you wish to @@ -521,6 +521,9 @@ def parseContent(content, blank_line=re.compile(r'[\r\n]+\s*[\r\n]+'), # # $Log: not supported by cvs2svn $ +# Revision 1.33 2001/11/13 21:44:44 richard +# . re-open the database as the author in mail handling +# # Revision 1.32 2001/11/12 22:04:29 richard # oops, left debug in there # -- 2.30.2