X-Git-Url: https://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=ljdump.py;fp=ljdump.py;h=5b7a7a4fbdfe2221685c7710581267420ebb9d9d;hb=245a811657855e2b846068dccdbbb83ced2c249e;hp=6a7e3a2655ff67d88814066c10332d17ef36c788;hpb=77d6008254c6ef87f8189294cbaa6ce332e6ab77;p=oss%2Fljdump.git diff --git a/ljdump.py b/ljdump.py index 6a7e3a2..5b7a7a4 100755 --- a/ljdump.py +++ b/ljdump.py @@ -259,13 +259,13 @@ def ljdump(Server, Username, Password): print >>f, """""" % (p, userpics[p]) pic = urllib2.urlopen(userpics[p]) ext = MimeExtensions.get(pic.info()["Content-Type"], "") - picfn = re.sub(r"[\/]", "_", p) + picfn = re.sub(r'[*?\\/:<>"|]', "_", p) try: picfn = codecs.utf_8_decode(picfn)[0] picf = open("%s/%s%s" % (Username, picfn, ext), "wb") except: # for installations where the above utf_8_decode doesn't work - picfn = "".join([ord(x) < 128 and x or "?" for x in picfn]) + picfn = "".join([ord(x) < 128 and x or "_" for x in picfn]) picf = open("%s/%s%s" % (Username, picfn, ext), "wb") shutil.copyfileobj(pic, picf) pic.close()