#2029 closed enhancement (duplicate)

'tahoe cp' gives a bad error message when no file name is specified.

Reported by: markberger Owned by:
Priority: normal Milestone: 1.10.1
Component: code-frontend-cli Version: 1.10.0
Keywords: Cc:
Launchpad Bug:


If the user attempts to copy a file from the top level of a directory without specifying a name, a confusing error message occurs.

Marks-MacBook-Pro-5:tahoe-fork markberger$ bin/tahoe cp tahoe:Seattle.jpg ~
Traceback (most recent call last):
  File "/Users/markberger/Code/tahoe-fork/src/allmydata/scripts/runner.py", line 156, in run
    rc = runner(sys.argv[1:], install_node_control=install_node_control)
  File "/Users/markberger/Code/tahoe-fork/src/allmydata/scripts/runner.py", line 141, in runner
    rc = cli.dispatch[command](so)
  File "/Users/markberger/Code/tahoe-fork/src/allmydata/scripts/cli.py", line 551, in cp
    rc = tahoe_cp.copy(options)
  File "/Users/markberger/Code/tahoe-fork/src/allmydata/scripts/tahoe_cp.py", line 770, in copy
    return Copier().do_copy(options)
  File "/Users/markberger/Code/tahoe-fork/src/allmydata/scripts/tahoe_cp.py", line 451, in do_copy
    status = self.try_copy()
  File "/Users/markberger/Code/tahoe-fork/src/allmydata/scripts/tahoe_cp.py", line 512, in try_copy
    return self.copy_to_directory(sources, target)
  File "/Users/markberger/Code/tahoe-fork/src/allmydata/scripts/tahoe_cp.py", line 672, in copy_to_directory
    self.copy_files_to_target(self.targetmap[target], target)
  File "/Users/markberger/Code/tahoe-fork/src/allmydata/scripts/tahoe_cp.py", line 703, in copy_files_to_target
    self.copy_file_into(source, name, target)
  File "/Users/markberger/Code/tahoe-fork/src/allmydata/scripts/tahoe_cp.py", line 748, in copy_file_into
    target.put_file(name, f)
  File "/Users/markberger/Code/tahoe-fork/src/allmydata/scripts/tahoe_cp.py", line 156, in put_file
    precondition(isinstance(name, unicode), name)
  File "/Users/markberger/Code/tahoe-fork/src/allmydata/util/assertutil.py", line 39, in precondition
    raise AssertionError, "".join(msgbuf)
AssertionError: precondition: 'Seattle.jpg' <type 'str'>

To close this ticket, the cli should give a clear message to the user such as: No file name has been specified for the download location. Please specify a file name. This ticket may be unnecessary depending on the result of #2027.

Change History (1)

comment:1 Changed at 2013-07-17T16:18:48Z by daira

  • Resolution set to duplicate
  • Status changed from new to closed

Merging into #2027.

Note: See TracTickets for help on using tickets.