Ignore:
Timestamp:
07/06/06 12:13:43 (18 years ago)
Author:
bas
Message:

EmailtoTracScript?:

email2trac.py.in:

  • Fixed some bugs
  • Preparing for new release
File:
1 edited

Legend:

Unmodified
Added
Removed
  • emailtotracscript/trunk/email2trac.py.in

    r91 r92  
    198198                        else:
    199199                                temp = string.strip(text)
     200                                temp = unicode(text, 'iso-8859-15')
    200201
    201202                        if str:
     
    408409                if self.EMAIL_HEADER > 0:
    409410                        head = self.email_header_txt(msg)
    410 
     411                       
    411412
    412413                body_text = self.get_body_text(msg)
     
    416417                # field of a ticket
    417418                #
    418                 tkt['description'] = u'email2trac:%s\r\n{{{\r\n%s\r\n}}}' \
     419                tkt['description'] = 'email2trac:%s\r\n{{{\r\n%s\r\n}}}' \
    419420                        %(head, body_text)
    420421
     
    432433                if self.MAILTO:
    433434                        mailto = self.html_mailto_link(self.to_unicode(msg['subject']), ticket_id, body_text)
    434                         tkt['description'] = u'email2trac:%s%s\r\n{{{\r\n%s\r\n}}}' %(head, mailto, body_text)
     435                        tkt['description'] = 'email2trac:%s%s\r\n{{{\r\n%s\r\n}}}' %(head, mailto, body_text)
    435436                        comment = '\nadded mailto line\n'
    436437                        changed = True
     
    608609                        # We try to normalize the filename to utf-8 NFC if we can.
    609610                        # Files uploaded from OS X might be in NFD.
     611                        # Check python version and then try it
    610612                        #
    611613                        if sys.version_info[0] > 2 or (sys.version_info[0] == 2 and sys.version_info[1] >= 3):
    612                                 filename = unicodedata.normalize('NFC', unicode(filename, 'utf-8')).encode('utf-8') 
     614                                try:
     615                                        filename = unicodedata.normalize('NFC', unicode(filename, 'utf-8')).encode('utf-8') 
     616                                except TypeError:
     617                                        pass
    613618
    614619                        url_filename = urllib.quote(filename)
Note: See TracChangeset for help on using the changeset viewer.