From 9820da5a0dc57675a32ba57452a1091c006af420 Mon Sep 17 00:00:00 2001 From: Karl Voit Date: Sun, 5 Apr 2015 14:23:41 +0200 Subject: [PATCH] fixed charset issue --- appendfilename.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/appendfilename.py b/appendfilename.py index f3b444e..7975373 100755 --- a/appendfilename.py +++ b/appendfilename.py @@ -204,7 +204,11 @@ def handle_file(origfilename, text, dryrun): logging.error('Could not extract file name components of \"%s\". Please do report.' % str(filename)) return - new_filename = old_basename + TEXT_SEPARATOR + text + tags_with_extension + try: + new_filename = old_basename + TEXT_SEPARATOR + text + tags_with_extension + except: + error_exit(7, "Error while trying to build new filename: " + str(sys.exc_info()[0])) + assert(isinstance(new_filename, unicode)) if dryrun: logging.info(u" ")