def s3_filename(filename):
 import string
 import unicodedata
 validFilenameChars = ('-_.() %s%s' % (string.ascii_letters, string.digits))
 filename = unicode(filename)
 cleanedFilename = unicodedata.normalize('NFKD', filename).encode('ASCII', 'ignore')
 return ''.join((c for c in cleanedFilename if (c in validFilenameChars)))

def s3_filename ( filename ) : import string import unicodedata validFilenameChars = ( '-_.() %s%s' % ( string . ascii_letters , string . digits ) ) filename = unicode ( filename ) cleanedFilename = unicodedata . normalize ( 'NFKD' , filename ) . encode ( 'ASCII' , 'ignore' ) return '' . join ( ( c for c in cleanedFilename if ( c in validFilenameChars ) ) )
convert a string into a valid filename on all os URL#698714 - currently unused .