1.1 --- a/imip_store.py Sat Mar 07 00:13:41 2015 +0100
1.2 +++ b/imip_store.py Sun Mar 08 01:35:43 2015 +0100
1.3 @@ -26,6 +26,7 @@
1.4 from os.path import exists, isfile, join
1.5 from os import listdir, remove, rmdir
1.6 from time import sleep
1.7 +import codecs
1.8
1.9 class FileStore(FileBase):
1.10
1.11 @@ -61,7 +62,7 @@
1.12
1.13 self.acquire_lock(user)
1.14 try:
1.15 - f = open(filename, "rb")
1.16 + f = codecs.open(filename, "rb", encoding="utf-8")
1.17 try:
1.18 l = []
1.19 for line in f.readlines():
1.20 @@ -88,7 +89,7 @@
1.21
1.22 self.acquire_lock(user)
1.23 try:
1.24 - f = open(filename, "wb")
1.25 + f = codecs.open(filename, "wb", encoding="utf-8")
1.26 try:
1.27 for item in items:
1.28 if empty_defaults:
1.29 @@ -514,11 +515,11 @@
1.30 rwrite(("UID", {}, user))
1.31 rwrite(("DTSTAMP", {}, datetime.utcnow().strftime("%Y%m%dT%H%M%SZ")))
1.32
1.33 - for start, end, uid, transp, recurrenceid in freebusy:
1.34 + for start, end, uid, transp, recurrenceid, summary, organiser in freebusy:
1.35 if not transp or transp == "OPAQUE":
1.36 rwrite(("FREEBUSY", {"FBTYPE" : "BUSY"}, "/".join([start, end])))
1.37
1.38 - f = open(filename, "w")
1.39 + f = open(filename, "wb")
1.40 try:
1.41 to_stream(f, make_calendar([("VFREEBUSY", {}, record)], "PUBLISH"))
1.42 finally: