From 286cc36496793337279c56b881418aa31590a2da Mon Sep 17 00:00:00 2001 From: owsla Date: Tue, 25 Dec 2007 03:45:13 +0000 Subject: Print a more helpful error message when we get a "Result too large" error git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@860 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 3 +++ rdiff-backup/rdiff_backup/rpath.py | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index fbc6afc..e4420b8 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -1,6 +1,9 @@ New in v1.1.15 (????/??/??) --------------------------- +Print a more helpful error message when we get a "Result too large" +error when trying to copy a file. (Andrew Ferguson) + Fix bug where rdiff-backup fails after all increments are removed. Closes Savannah bug #20291. (Andrew Ferguson) diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py index 7b71ff1..dbb49f6 100644 --- a/rdiff-backup/rdiff_backup/rpath.py +++ b/rdiff-backup/rdiff_backup/rpath.py @@ -125,7 +125,17 @@ def copy_reg_file(rpin, rpout, compress = 0): rpout.setdata() return v except AttributeError: pass - return rpout.write_from_fileobj(rpin.open("rb"), compress = compress) + try: + return rpout.write_from_fileobj(rpin.open("rb"), compress = compress) + except IOError, e: + if (e.errno == errno.ERANGE): + log.Log.FatalError("'IOError - Result too large' while reading %s. " + "If you are using a Mac, this is probably " + "the result of HFS+ filesystem corruption. " + "Please exclude this file from your backup " + "before proceeding." % rpin.path) + else: + raise def cmp(rpin, rpout): """True if rpin has the same data as rpout -- cgit v1.2.1