[tahoe-lafs-trac-stream] [tahoe-lafs] #2027: Inconsistent 'tahoe cp' behavior (was: Inconsistent 'tahoe cp' Behavior)

tahoe-lafs trac at tahoe-lafs.org
Wed Jul 17 16:22:30 UTC 2013


#2027: Inconsistent 'tahoe cp' behavior
---------------------------+-----------------------------------------------
     Reporter:             |      Owner:  daira
  markberger               |     Status:  assigned
         Type:  defect     |  Milestone:  1.11.0
     Priority:  normal     |    Version:  1.10.0
    Component:  code-      |   Keywords:  usability error cli tahoe-cp easy
  frontend-cli             |
   Resolution:             |
Launchpad Bug:             |
---------------------------+-----------------------------------------------
Description changed by daira:

Old description:

> When copying a file from the top level of a directory node using the CLI,
> tahoe requires a file name to be specified.
>
> Ex: {{{tahoe cp tahoe:test.jpg ~}}} fails with the following assertion
> traceback, while {{{tahoe cp tahoe:test.jpg ~/test.jpg }}} succeeds.
>
> {{{
> 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'>
> }}}
>
> However, when a file is copied from a subdirectory to the local disk
> without a specified file name, the download will succeed.
>
> Ex: {{{tahoe cp tahoe:test/test.jpg ~}}} succeeds along with {{{tahoe cp
> tahoe:test/test.jpg ~/test.jpg}}}.
>
> The CLI's behavior should be consistent. Either require users to specify
> a file name for all cp actions or allow users to copy files from the top
> level of a directory  to a local directory without specifying a file
> name.

New description:

 When copying a file from the top level of a directory node using the CLI,
 tahoe requires a file name to be specified.

 Ex: {{{tahoe cp tahoe:Seattle.jpg ~}}} fails with the following assertion
 traceback, while {{{tahoe cp tahoe:Seattle.jpg ~/Seattle.jpg}}} succeeds.

 {{{
 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'>
 }}}

 However, when a file is copied from a subdirectory to the local disk
 without a specified file name, the download will succeed.

 Ex: {{{tahoe cp tahoe:test/Seattle.jpg ~}}} succeeds along with {{{tahoe
 cp tahoe:test/Seattle.jpg ~/Seattle.jpg}}}.

 All four cases should succeed.

--

-- 
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2027#comment:4>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list