TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

Bug #529869 reported by Mike Rogers
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

Only occurs in latest version (0.6.07).

Traceback (most recent call last):
 File "/usr/bin/duplicity", line 1236, in ?
   with_tempdir(main)
 File "/usr/bin/duplicity", line 1229, in with_tempdir
   fn()
 File "/usr/bin/duplicity", line 1115, in main
   action = commandline.ProcessCommandLine(sys.argv[1:])
 File "/usr/lib/python2.4/site-packages/duplicity/commandline.py", line 876, in ProcessCommandLine
   args = parse_cmdline_options(cmdline_list)
 File "/usr/lib/python2.4/site-packages/duplicity/commandline.py", line 503, in parse_cmdline_options
   globals.remove_time = dup_time.genstrtotime(arg)
 File "/usr/lib/python2.4/site-packages/duplicity/dup_time.py", line 271, in genstrtotime
   return override_curtime - intstringtoseconds(timestr)
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

Related branches

Revision history for this message
Phil Veal (pmveal) wrote :

I just ran into this after upgrading from 0.6.06 to 0.6.07 -

duplicity --name BACKUP1 --full-if-older-than 1M --no-encryption --include-globbing-filelist filelist / file:///media/BACKUP1
Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1236, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1229, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1115, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python2.6/dist-packages/duplicity/commandline.py", line 876, in ProcessCommandLine
    args = parse_cmdline_options(cmdline_list)
  File "/usr/lib/python2.6/dist-packages/duplicity/commandline.py", line 450, in parse_cmdline_options
    (options, args) = parser.parse_args()
  File "/usr/lib/python2.6/optparse.py", line 1394, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.6/optparse.py", line 1434, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python2.6/optparse.py", line 1509, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python2.6/optparse.py", line 782, in process
    value = self.convert_value(opt, value)
  File "/usr/lib/python2.6/optparse.py", line 774, in convert_value
    return self.check_value(opt, value)
  File "/usr/lib/python2.6/optparse.py", line 769, in check_value
    return checker(self, opt, value)
  File "/usr/lib/python2.6/dist-packages/duplicity/commandline.py", line 110, in check_time
    return dup_time.genstrtotime(value)
  File "/usr/lib/python2.6/dist-packages/duplicity/dup_time.py", line 271, in genstrtotime
    return override_curtime - intstringtoseconds(timestr)
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

In my case the workaround is to remove "-full-if-older-than 1M" and to specify a full or incremental backup explicitly.

I believe the problem is that in duplicity main(), commandline.ProcessCommandLine() is now called before dup_time.setcurtime(), so the curtime global is not set.

Michael Terry (mterry)
Changed in duplicity:
assignee: nobody → Michael Terry (mterry)
Changed in duplicity:
milestone: none → 0.6.08
importance: Undecided → Medium
status: New → Fix Committed
Changed in duplicity:
assignee: Michael Terry (mterry) → nobody
Revision history for this message
Phil Veal (pmveal) wrote :

The patch resolves the problem for me. Thanks for the quick fix.

Changed in duplicity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.