summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2014-07-09 12:18:45 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2014-07-09 12:18:45 +0200
commit158ef5339c36fe864d903f607d309d643e721324 (patch)
tree5bdb97fa48594ae40deb0a1c3227401da30ffb12 /module
parentImproved filename sanitation. (diff)
downloadpyload-158ef5339c36fe864d903f607d309d643e721324.tar.xz
Improved filename sanitation removing non-ascii chars.
Diffstat (limited to 'module')
-rw-r--r--module/utils.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/module/utils.py b/module/utils.py
index 6abee5eab..5a98b8d4a 100644
--- a/module/utils.py
+++ b/module/utils.py
@@ -41,6 +41,7 @@ def remove_chars(string, repl):
def save_path(name):
#remove some chars
+ name = name.encode('ascii', 'replace') # Non-ASCII chars usually breaks file saving. Replacing.
if os.name == 'nt':
return remove_chars(name, u'\00\01\02\03\04\05\06\07\10\11\12\13\14\15\16\17\20\21\22\23\24\25\26\27\30\31\32'
u'\33\34\35\36\37/\\?%*:|"<>')