Permalink
Browse files

Using pax tar archive format for storing backup data to support Unico…

…de file names
  • Loading branch information...
1 parent ff99cc8 commit 753418f670df2d63609aef86ae2aab0a5d4638b0 @KonishchevDmitry committed Jan 7, 2013
Showing with 11 additions and 1 deletion.
  1. +5 −0 ChangeLog
  2. +4 −0 pyvsb/backup.py
  3. +2 −1 pyvsb/utils.py
View
@@ -1,3 +1,8 @@
+-----------
+ * Using pax tar archive format for storing backup data to support Unicode
+ file names.
+
+
Version 0.3
-----------
* Fully rewritten and rethought code and configuration file format.
View
@@ -121,6 +121,10 @@ def add_file(self, path, stat_info, link_target = None, file_obj = None):
if self.__state != _STATE_OPENED:
raise Error("The backup file is closed")
+ # Limitation of tar format
+ if "\0" in path:
+ raise Error(r"File names with '\0' aren't supported")
+
# Limitation due to using text files for metadata
if "\r" in path or "\n" in path:
raise Error(r"File names with '\r' or '\n' aren't supported")
View
@@ -74,7 +74,8 @@ def __init__(self, path, write = None, decompress = True):
file_format = self.__formats[write]
self.__file = tarfile.open(
- path + file_format["extension"], "w" + file_format["mode"])
+ path + file_format["extension"], "w" + file_format["mode"],
+ format = tarfile.PAX_FORMAT)
except:
self.close()
raise

0 comments on commit 753418f

Please sign in to comment.