Cygwin: TypeError: basis_file must be a (true) file, while restoring inremental backup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I am unable to restore files from incremental backup, while restoring files from FULL backup seems to be ok.
The error is "TypeError: basis_file must be a (true) file"
This is a major problem for me , since I use duplicity on a daily basis to back up my windows documents and files.
Backup storage is local drive.
All backed up files are from local drive.
See attachment for details.
Environment:
Windowx XP SP3 + latest cygwin.
Error summary:
bash-3.2$ uname -a
CYGWIN_NT-5.1 cy2k 1.7.7(0.230/5/3) 2010-08-31 09:58 i686 Cygwin
bash-3.2$ duplicity --version
duplicity 0.6.10
bash-3.2$ python --version
Python 2.6.5
Error Stack Trace:
Traceback (most recent call last):
File "/usr/bin/
with_
File "/usr/bin/
fn()
File "/usr/bin/
restore(
File "/usr/bin/
restore_
File "/usr/lib/
for ropath in rop_iter:
File "/usr/lib/
final_ropath = patch_seq2ropath( normalize_ps( patch_seq ) )
File "/usr/lib/
delta_
File "/usr/lib/
raise TypeError(
TypeError: basis_file must be a (true) file
Changed in duplicity: | |
importance: | Undecided → Medium |
milestone: | none → 0.6.12 |
status: | New → Fix Committed |
Changed in duplicity: | |
status: | Fix Committed → In Progress |
status: | In Progress → Fix Released |
Hi there,
I bumped into the same problem while running duplicity 0.6.11 (patched as of http:// jager.no/ projects/ windows/ duplicity- on-windows) using cygwin 1.7.7 and python 2.6.5 on Windows 7.
The problem is that, as explained in the Python documentation (http:// docs.python. org/library/ tempfile. html), tempfile. TemporaryFile returns a *file-like* object, not a file object. Under Linux, it effectively returns a file object but under windows it does not. Hence, the type of the object returned is *not* a types.FileType, causing the exception to be raised.
Further references:
http:// bytes.com/ topic/python/ answers/ 36024-bug- windows- tempfile- py /msg00675. html
http://<email address hidden>
I found a workaround (patch attached) by replacing in src/patchdir.py "tempfile. TemporaryFile( )" with "os.tmpfile()", which, instead, returns a file object (http:// docs.python. org/library/ os.html).
Hope it helps,
Paolo