Changeset 376 for trunk


Ignore:
Timestamp:
06/21/10 17:06:40 (14 years ago)
Author:
bas
Message:

Fixed some UnicodeEncodeErrors? when in debug mode, see #206.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r373 r376  
    517517                        n = n + 1
    518518                        print 'TD: part%d: Content-Type: %s' % (n, part.get_content_type())
    519                         print 'TD: part%d: filename: %s' % (n, filename)
     519                       
     520                        try:
     521                                print 'TD: part%d: filename: %s' % (n, filename)
     522                        except UnicodeEncodeError, detail:
     523                                print 'Filename can not be printed due to non-ascii characters'
    520524
    521525                        ## Forbidden chars
     
    526530
    527531                        part_file = os.path.join(self.TMPDIR, filename)
    528                         print 'TD: writing part%d (%s)' % (n,part_file)
     532                        try:
     533                                print 'TD: writing part%d (%s)' % (n,part_file)
     534                        except UnicodeEncodeError, detail:
     535                                print 'Filename can not be printed due to non-ascii characters'
    529536
    530537                        if self.DRY_RUN:
Note: See TracChangeset for help on using the changeset viewer.