diff options
author | joshn <joshn@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2009-04-09 13:59:19 +0000 |
---|---|---|
committer | joshn <joshn@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2009-04-09 13:59:19 +0000 |
commit | e4c108ce309ff198af46f99acfdd1ef95d90acec (patch) | |
tree | 2701c6049ccb394b048168c873a0405ab7f1933f /rdiff-backup/rdiff_backup/statistics.py | |
parent | 675f2a8ccb7b67789940594b38c454295693e373 (diff) | |
download | rdiff-backup-e4c108ce309ff198af46f99acfdd1ef95d90acec.tar.gz |
Use Unicode for paths internally to add support for Unicode on Windows.
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@1053 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/statistics.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/statistics.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/rdiff-backup/rdiff_backup/statistics.py b/rdiff-backup/rdiff_backup/statistics.py index 0bdd439..1df602a 100644 --- a/rdiff-backup/rdiff_backup/statistics.py +++ b/rdiff-backup/rdiff_backup/statistics.py @@ -20,7 +20,7 @@ """Generate and process aggregated backup information""" import re, os, time -import Globals, Time, increment, log, static, metadata +import Globals, Time, increment, log, static, metadata, rpath class StatsException(Exception): pass @@ -219,13 +219,13 @@ class StatsObj: def write_stats_to_rp(self, rp): """Write statistics string to given rpath""" - fp = rp.open("wb") + fp = rpath.UnicodeFile(rp.open("wb")) fp.write(self.get_stats_string()) assert not fp.close() def read_stats_from_rp(self, rp): """Set statistics from rpath, return self for convenience""" - fp = rp.open("r") + fp = rpath.UnicodeFile(rp.open("r")) self.set_stats_from_string(fp.read()) fp.close() return self @@ -364,7 +364,8 @@ class FileStats: suffix = Globals.compression and 'data.gz' or 'data' cls._rp = increment.get_inc(rpbase, suffix, Time.curtime) assert not cls._rp.lstat() - cls._fileobj = cls._rp.open("wb", compress = Globals.compression) + cls._fileobj = rpath.UnicodeFile(cls._rp.open("wb", + compress = Globals.compression)) cls._line_sep = Globals.null_separator and '\0' or '\n' cls.write_docstring() |