summaryrefslogtreecommitdiff
path: root/ybd/utils.py
diff options
context:
space:
mode:
authorDaniel Firth <dan.firth@codethink.co.uk>2016-11-29 13:02:10 +0000
committerDaniel Firth <dan.firth@codethink.co.uk>2016-11-29 13:02:10 +0000
commit6de6526fc13493722537811c4a5c0e920cc94c0a (patch)
tree8d8afdde009265658b10dc72c80128ba579e5844 /ybd/utils.py
parent77eeeea1b20b6e0f11c9903000a86d3148881853 (diff)
downloadybd-6de6526fc13493722537811c4a5c0e920cc94c0a.tar.gz
Revert "Update code to python3"lc/revert-py3.4
This reverts commit 62915d16b2d5577f937e70c3a12e67f331aa87a7.
Diffstat (limited to 'ybd/utils.py')
-rw-r--r--ybd/utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/ybd/utils.py b/ybd/utils.py
index 8fe4b30..13a61c8 100644
--- a/ybd/utils.py
+++ b/ybd/utils.py
@@ -23,7 +23,7 @@ import stat
from fs.osfs import OSFS
from fs.multifs import MultiFS
import calendar
-from ybd import app
+import app
# The magic number for timestamps: 2011-11-11 11:11:11
default_magic_timestamp = calendar.timegm([2011, 11, 11, 11, 11, 11])
@@ -150,8 +150,8 @@ def _process_tree(root, srcpath, destpath, actionfunc):
except:
import traceback
traceback.print_exc()
- print('destpath is', destpath)
- print('realpath is', realpath)
+ print 'destpath is', destpath
+ print 'realpath is', realpath
app.log('UTILS', 'ERROR: file operation failed', exit=True)
@@ -210,8 +210,8 @@ def copy_file_list(srcpath, destpath, filelist):
'''
def _copyfun(inpath, outpath):
- with open(inpath, "r", encoding='utf-8', errors='ignore') as infh:
- with open(outpath, "w", encoding='utf-8', errors='ignore') as outfh:
+ with open(inpath, "r") as infh:
+ with open(outpath, "w") as outfh:
shutil.copyfileobj(infh, outfh, 1024*1024*4)
shutil.copystat(inpath, outpath)