- Timestamp:
- 06/22/10 10:25:37 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/email2trac.py.in
r376 r377 521 521 print 'TD: part%d: filename: %s' % (n, filename) 522 522 except UnicodeEncodeError, detail: 523 print ' Filename can not be printed due to non-ascii characters'523 print 'TD: part%d: filename: %s' % (n, util.text.unicode_quote(filename)) 524 524 525 525 ## Forbidden chars … … 533 533 print 'TD: writing part%d (%s)' % (n,part_file) 534 534 except UnicodeEncodeError, detail: 535 print ' Filename can not be printed due to non-ascii characters'535 print 'TD: writing part%d (%s)' % (n, util.text.unicode_quote(part_file)) 536 536 537 537 if self.DRY_RUN: 538 538 print 'DRY_RUN: NOT saving attachments' 539 539 continue 540 541 part_file = util.text.unicode_quote(part_file) 540 542 541 543 fx = open(part_file, 'wb') … … 592 594 if self.VERBOSE: 593 595 print "VB: email_to_unicode" 596 597 594 598 595 599 results = email.Header.decode_header(message_str) … … 1096 1100 (original, filename, part) = item 1097 1101 # 1098 # Must be tuneables HvB 1099 # 1100 path, fd = util.create_unique_file(os.path.join(self.TMPDIR, filename)) 1102 # We have to determine the size so we use this temporary solution. we must escape it 1103 # else we get UnicodeErrors. 1104 # 1105 path, fd = util.create_unique_file(os.path.join(self.TMPDIR, util.text.unicode_quote(filename))) 1101 1106 text = part.get_payload(decode=1) 1102 1107 if not text: … … 1768 1773 print 'TD: Filename: %s' % part.get_filename() 1769 1774 except UnicodeEncodeError, detail: 1770 print 'TD: Filename: Can not be printed due to non-ascii characters'1771 1772 ## Convert 7-bit filename to 8 bits value1775 print 'TD: Filename: %s' % util.text.unicode_quote(part.get_filename()) 1776 1777 ## 1773 1778 # 1774 filename = self.email_to_unicode(part.get_filename())1779 filename = part.get_filename() 1775 1780 message_parts.append((filename, part)) 1776 1781
Note: See TracChangeset
for help on using the changeset viewer.