Skip to content

Instantly share code, notes, and snippets.

@vkosh
Created March 8, 2012 23:12
Show Gist options
  • Save vkosh/2004045 to your computer and use it in GitHub Desktop.
Save vkosh/2004045 to your computer and use it in GitHub Desktop.
From 9c22490b0e4219c4bcbaa8e746ce88f595f4a75c Mon Sep 17 00:00:00 2001
From: Vladlen Y. Koshelev <vlad.kosh@gmail.com>
Date: Fri, 9 Mar 2012 00:41:07 +0400
Subject: [PATCH 2/3] - file names decoding
---
esky/fstransact/win32txf.py | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/esky/fstransact/win32txf.py b/esky/fstransact/win32txf.py
index 89e1e1a..54b28b4 100644
--- a/esky/fstransact/win32txf.py
+++ b/esky/fstransact/win32txf.py
@@ -111,8 +111,8 @@ class FSTransaction(object):
self._remove(source)
def _move(self,source,target):
- source = source.encode(sys.getfilesystemencoding())
- target = target.encode(sys.getfilesystemencoding())
+# source = source.encode(sys.getfilesystemencoding())
+# target = target.encode(sys.getfilesystemencoding())
if os.path.exists(target) and target != source:
target_old = get_backup_filename(target)
MoveFileTransacted(target,target_old,None,None,1,self.trnid)
@@ -158,8 +158,8 @@ class FSTransaction(object):
self._copy(source,target)
def _copy(self,source,target):
- source = source.encode(sys.getfilesystemencoding())
- target = target.encode(sys.getfilesystemencoding())
+# source = source.encode(sys.getfilesystemencoding())
+# target = target.encode(sys.getfilesystemencoding())
if os.path.exists(target) and target != source:
target_old = get_backup_filename(target)
MoveFileTransacted(target,target_old,None,None,1,self.trnid)
@@ -192,7 +192,7 @@ class FSTransaction(object):
self._remove(target)
def _remove(self,target):
- target = target.encode(sys.getfilesystemencoding())
+# target = target.encode(sys.getfilesystemencoding())
if os.path.isdir(target):
for nm in os.listdir(target):
self.remove(os.path.join(target,nm))
--
1.7.3.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment