Changeset 347


Ignore:
Timestamp:
04/12/10 15:32:46 (14 years ago)
Author:
bas
Message:

email2trac.py.in:

  • re-enabled normalizing for filenames (attachments)
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r345 r347  
     12010-XX-XX
     2
     3
    142010-03-20
    25
  • trunk/email2trac.py.in

    r345 r347  
    14861486                                filename = '%s%s' % (filename, ext)
    14871487
    1488 # We now use the attachment insert function
    1489 #
    14901488                        ## Discard relative paths in attachment names
    14911489                        #
    1492                         #filename = filename.replace('\\', '/').replace(':', '/')
    1493                         #filename = os.path.basename(filename)
     1490                        filename = filename.replace('\\', '/').replace(':', '/')
     1491                        filename = os.path.basename(filename)
     1492
    14941493                        #
    14951494                        # We try to normalize the filename to utf-8 NFC if we can.
     
    14971496                        # Check python version and then try it
    14981497                        #
    1499                         #if sys.version_info[0] > 2 or (sys.version_info[0] == 2 and sys.version_info[1] >= 3):
    1500                         #       try:
    1501                         #               filename = unicodedata.normalize('NFC', unicode(filename, 'utf-8')).encode('utf-8') 
    1502                         #       except TypeError:
    1503                         #               pass
     1498                        if sys.version_info[0] > 2 or (sys.version_info[0] == 2 and sys.version_info[1] >= 3):
     1499                                try:
     1500                                        filename = unicodedata.normalize('NFC', unicode(filename, 'utf-8')).encode('utf-8') 
     1501                                except TypeError:
     1502                                        pass
    15041503
    15051504                        # Make the filename unique for this ticket
Note: See TracChangeset for help on using the changeset viewer.