cp -r stops with an exception #2329

Closed
opened 2014-11-07 13:56:10 +00:00 by zooko · 51 comments
$ tahoe cp --verbose -r $CAP .
Traceback (most recent call last):
  File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/runner.py", line 156, in run
    rc = runner(sys.argv[1:], install_node_control=install_node_control)
  File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/runner.py", line 141, in runner
    rc = cli.dispatch[command](so)
  File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/cli.py", line 551, in cp
    rc = tahoe_cp.copy(options)
  File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 774, in copy
    return Copier().do_copy(options)
  File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 451, in do_copy
    status = self.try_copy()
  File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 513, in try_copy
    return self.copy_to_directory(sources, target)
  File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 617, in copy_to_directory
    source_dirs = self.build_graphs(source_infos)
  File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 768, in build_graphs
    name = os.path.basename(os.path.normpath(name))
  File "/usr/lib/python2.7/posixpath.py", line 342, in normpath
    initial_slashes = path.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
$ tahoe --version
allmydata-tahoe: 1.10.0.post167 [1382-rewrite-4: 102d5846b53a715bd9a51aac20f325dd6f6830be]
foolscap: 0.6.4 
pycryptopp: 0.6.0.1206569328141510525648634803928199668821045408958
zfec: 1.4.24
Twisted: 13.0.0 
Nevow: 0.11.1   
zope.interface: unknown
python: 2.7.6   
platform: Linux-Ubuntu_14.04-x86_64-64bit_ELF
pyOpenSSL: 0.13 
simplejson: 3.3.1
pycrypto: 2.6.1 
pyasn1: 0.1.7   
mock: 1.0.1
service-identity: 14.0.0
setuptools: 0.6c16dev4

``` $ tahoe cp --verbose -r $CAP . ``` ``` Traceback (most recent call last): File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/runner.py", line 156, in run rc = runner(sys.argv[1:], install_node_control=install_node_control) File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/runner.py", line 141, in runner rc = cli.dispatch[command](so) File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/cli.py", line 551, in cp rc = tahoe_cp.copy(options) File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 774, in copy return Copier().do_copy(options) File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 451, in do_copy status = self.try_copy() File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 513, in try_copy return self.copy_to_directory(sources, target) File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 617, in copy_to_directory source_dirs = self.build_graphs(source_infos) File "/home/zooko/playground/tahoe/tahoe-lafs/src/allmydata/scripts/tahoe_cp.py", line 768, in build_graphs name = os.path.basename(os.path.normpath(name)) File "/usr/lib/python2.7/posixpath.py", line 342, in normpath initial_slashes = path.startswith('/') AttributeError: 'NoneType' object has no attribute 'startswith' ``` ``` $ tahoe --version allmydata-tahoe: 1.10.0.post167 [1382-rewrite-4: 102d5846b53a715bd9a51aac20f325dd6f6830be] foolscap: 0.6.4 pycryptopp: 0.6.0.1206569328141510525648634803928199668821045408958 zfec: 1.4.24 Twisted: 13.0.0 Nevow: 0.11.1 zope.interface: unknown python: 2.7.6 platform: Linux-Ubuntu_14.04-x86_64-64bit_ELF pyOpenSSL: 0.13 simplejson: 3.3.1 pycrypto: 2.6.1 pyasn1: 0.1.7 mock: 1.0.1 service-identity: 14.0.0 setuptools: 0.6c16dev4 ```
zooko added the
c/code-frontend-cli
p/normal
t/defect
v/1.10.0
labels 2014-11-07 13:56:10 +00:00
zooko added this to the undecided milestone 2014-11-07 13:56:10 +00:00
Author

When I tried the same thing with the Tahoe-LAFS v1.10.0 release (from Ubuntu), it worked! So this is a regression.

When I tried the same thing with the Tahoe-LAFS v1.10.0 release (from Ubuntu), it worked! So this is a regression.
zooko modified the milestone from undecided to 1.11.0 2014-11-07 14:33:27 +00:00
daira added
p/major
and removed
p/normal
labels 2014-11-19 07:15:05 +00:00
daira self-assigned this 2014-11-19 07:15:05 +00:00

Possibly caused by the fix to #712 (which was the last patch to touch the code where the error occurs: source:trunk/src/allmydata/scripts/tahoe_cp.py?annotate=blame#L767 )

Possibly caused by the fix to #712 (which was the last patch to touch the code where the error occurs: source:trunk/src/allmydata/scripts/tahoe_cp.py?annotate=blame#L767 )
Test (which fails) at <https://github.com/tahoe-lafs/tahoe-lafs/commit/2329-test-0>.

Review needed for the test.

Review needed for the test.
daira removed their assignment 2014-11-26 03:38:20 +00:00
zooko was assigned by daira 2014-11-26 03:38:20 +00:00

warner will review the test, commit it with a TODO flag, then try to solve the original problem

warner will review the test, commit it with a TODO flag, then try to solve the original problem
zooko was unassigned by warner 2015-01-20 17:54:48 +00:00
warner self-assigned this 2015-01-20 17:54:48 +00:00

So it looks like the intention of #712 was to make a command like cp -r A LOCAL or cp -r A LOCAL/ create LOCAL/A. This depends upon "A" including a file or directory name (eg cp -r DIRCAP/foo.txt LOCAL/). But if A is a pure cap, then it has no human-meaningful name. What should get created in this case?

I think the #2329 bug is resulting from a code path that assumes it will be provided with a name, and the pure-cap source argument doesn't give it one.

So it looks like the intention of #712 was to make a command like `cp -r A LOCAL` or `cp -r A LOCAL/` create `LOCAL/A`. This depends upon "A" including a file or directory name (eg `cp -r DIRCAP/foo.txt LOCAL/`). But if A is a pure cap, then it has no human-meaningful name. What should get created in this case? I think the #2329 bug is resulting from a code path that assumes it will be provided with a name, and the pure-cap source argument doesn't give it one.

Well, what did it do in Tahoe-LAFS v1.10.0? (There are two cases: $CAP is a file cap, or a directory cap.)

Well, what did it do in Tahoe-LAFS v1.10.0? (There are two cases: $CAP is a file cap, or a directory cap.)

From a tahoe-side tree with PARENTCAP, DIRCAP=PARENTCAP/dir, and FILECAP=PARENTCAP/dir/file.txt, and a local (real) target directory "local":

  • 1.10
  • (A) cp -r PARENTCAP/dir local/ -> local/file.txt
  • (B) cp -r DIRCAP local/ -> local/file.txt
  • (C) cp -r DIRCAP_ALIAS: local/ -> local/file.txt
  • (D) cp -r DIRCAP/file.txt local/ -> local/file.txt
  • (E) cp -r FILECAP local/ -> "error, you must specify a destination filename"
  • note the target's trailing slash is optional: local/ and local behave the same way
  • trunk (e73d76e)
  • (F) cp -r PARENTCAP/dir local/ -> local/dir/file.txt
  • (G) cp -r DIRCAP local/ -> (exception)
  • (H) cp -r DIRCAP_ALIAS: local/ -> (exception)
  • (I) cp -r DIRCAP/file.txt local/ -> local/file.txt
  • (J) cp -r FILECAP local/ -> "error, you must specify a destination filename"

#712 fixed F to behave more like regular POSIX /bin/cp. I can think of three ways we might go with case G and H:

  • 1: cp -r DIRCAP local/ should behave like an imaginary cp -r DIRCAP/* local/ would do (this is imaginary because we have no tahoe-side globs). In this example, it'd create local/file.txt. This would match what it did in 1.10 (case B/C), but wouldn't match F. That'd be a shame, because we generally claim that "PARENTCAP/dir" and "DIRCAP" and "ALIAS:" are all interchangeable.

  • 2: cp -r DIRCAP local/ would pretend that the source directory was named after the actual DIRCAP string (the ugly base32 representation), and create local/BASE32DIRCAP/file.txt . Ick. For H we could use the alias name as a target name, so it'd create local/ALIASNAME/file.txt, which is still lame but at least human-readable.

  • 3: cp -r DIRCAP local/ would complain "you must specify a destination directory name", like cases E and J. This is somewhat plausible for G, and looks slightly weird for H.

We don't have enough information to make case G behave like F.

From a tahoe-side tree with PARENTCAP, DIRCAP=PARENTCAP/dir, and FILECAP=PARENTCAP/dir/file.txt, and a local (real) target directory "local": * 1.10 * (A) `cp -r PARENTCAP/dir local/` -> `local/file.txt` * (B) `cp -r DIRCAP local/` -> `local/file.txt` * (C) `cp -r DIRCAP_ALIAS: local/` -> `local/file.txt` * (D) `cp -r DIRCAP/file.txt local/` -> `local/file.txt` * (E) `cp -r FILECAP local/` -> "error, you must specify a destination filename" * note the target's trailing slash is optional: `local/` and `local` behave the same way * trunk (e73d76e) * (F) `cp -r PARENTCAP/dir local/` -> `local/dir/file.txt` * (G) `cp -r DIRCAP local/` -> (exception) * (H) `cp -r DIRCAP_ALIAS: local/` -> (exception) * (I) `cp -r DIRCAP/file.txt local/` -> `local/file.txt` * (J) `cp -r FILECAP local/` -> "error, you must specify a destination filename" #712 fixed F to behave more like regular POSIX `/bin/cp`. I can think of three ways we might go with case G and H: * 1: `cp -r DIRCAP local/` should behave like an imaginary `cp -r DIRCAP/* local/` would do (this is imaginary because we have no tahoe-side globs). In this example, it'd create `local/file.txt`. This would match what it did in 1.10 (case B/C), but wouldn't match F. That'd be a shame, because we generally claim that "PARENTCAP/dir" and "DIRCAP" and "ALIAS:" are all interchangeable. * 2: `cp -r DIRCAP local/` would pretend that the source directory was named after the actual DIRCAP string (the ugly base32 representation), and create `local/BASE32DIRCAP/file.txt` . Ick. For H we could use the alias name as a target name, so it'd create `local/ALIASNAME/file.txt`, which is still lame but at least human-readable. * 3: `cp -r DIRCAP local/` would complain "you must specify a destination directory name", like cases E and J. This is somewhat plausible for G, and looks slightly weird for H. We don't have enough information to make case G behave like F.

Well, I guess I'm going to implement option 1: make cp -r DIRCAP local/ behave like it used to (putting the contents of DIRCAP into local/) instead of like how cp -r PARENTCAP/dir local/ does now (making a new subdirectory under local/). It's not super consistent, but it's better than an exception.

Well, I guess I'm going to implement option 1: make `cp -r DIRCAP local/` behave like it used to (putting the contents of DIRCAP into local/) instead of like how `cp -r PARENTCAP/dir local/` does now (making a new subdirectory under local/). It's not super consistent, but it's better than an exception.

+1 for option 1.

+1 for option 1.

When I said +1 for option 1, I was thinking that the previous behaviour of cases (B) and (C) --i.e. copying the contents of a dircap into a directory-- would become inexpressible. However I now understand the error in option 3 to be saying that "you must specify a previously nonexisting destination directory name". In that case you could still write:

  • (J2) cp -r DIRCAP local/missing -> local/missing

which would be consistent with cases (F) and (I), because local/missing becomes a copy of DIRCAP.

When I said +1 for option 1, I was thinking that the previous behaviour of cases (B) and (C) --i.e. copying the contents of a dircap into a directory-- would become inexpressible. However I now understand the error in option 3 to be saying that "you must specify a previously nonexisting destination directory name". In that case you could still write: * (J2) `cp -r DIRCAP local/missing -> local/missing` which would be consistent with cases (F) and (I), because `local/missing` becomes a copy of `DIRCAP`.

If there were a tahoe-side globbing feature, the error messages in option 3 could say:

"""
To copy the contents of this dircap into an existing destination directory append /*; eg:

tahoe cp -r "$DIRCAP/*" /path/to/existing/dir

To create a new directory with the contents of this dircap, specify a new local directory name; eg:

tahoe cp -r "$DIRCAP" /path/to/nonexisting
"""

A glob feature would allow the explicit indication of whether a bag, or the contents of the bag, should be copied.

If there were a tahoe-side globbing feature, the error messages in option 3 could say: """ To copy the contents of this dircap into an existing destination directory append /*; eg: > tahoe cp -r "$DIRCAP/*" /path/to/existing/dir To create a new directory with the contents of this dircap, specify a new local directory name; eg: > tahoe cp -r "$DIRCAP" /path/to/nonexisting """ A glob feature would allow the explicit indication of whether a bag, or the contents of the bag, should be copied.

Splitting by whether the destination exists or not:

  • 1.10
  • (A1) cp -r PARENTCAP/dir local/ -> local/file.txt
  • (A2) cp -r PARENTCAP/dir local/missing -> ?
  • (B1) cp -r DIRCAP local/ -> local/file.txt
  • (B2) cp -r DIRCAP local/missing -> ?
  • (C1) cp -r DIRCAP_ALIAS: local/ -> local/file.txt
  • (C2) cp -r DIRCAP_ALIAS: local/missing -> ?
  • (D1) cp -r DIRCAP/file.txt local/ -> local/file.txt
  • (D2) cp -r DIRCAP/file.txt local/missing -> local/missing
  • (E1) cp -r FILECAP local/ -> "error, you must specify a destination filename"
  • (E2) cp -r FILECAP local/missing -> local/missing
  • note the target's trailing slash is optional: local/ and local behave the same way
  • trunk (e73d76e)
  • (F1) cp -r PARENTCAP/dir local/ -> local/dir/file.txt
  • (F2) cp -r PARENTCAP/dir local/missing -> ?
  • (G1) cp -r DIRCAP local/ -> (exception)
  • (G2) cp -r DIRCAP local/missing -> (exception?)
  • (H1) cp -r DIRCAP_ALIAS: local/ -> (exception)
  • (H2) cp -r DIRCAP_ALIAS: local/missing -> (exception?)
  • (I1) cp -r DIRCAP/file.txt local/ -> local/file.txt
  • (I2) cp -r DIRCAP/file.txt local/missing -> local/missing
  • (J1) cp -r FILECAP local/ -> "error, you must specify a destination filename"
  • (J2) cp -r FILECAP local/missing -> local/missing
Splitting by whether the destination exists or not: * 1.10 * (A1) `cp -r PARENTCAP/dir local/` -> `local/file.txt` * (A2) `cp -r PARENTCAP/dir local/missing` -> ? * (B1) `cp -r DIRCAP local/` -> `local/file.txt` * (B2) `cp -r DIRCAP local/missing` -> ? * (C1) `cp -r DIRCAP_ALIAS: local/` -> `local/file.txt` * (C2) `cp -r DIRCAP_ALIAS: local/missing` -> ? * (D1) `cp -r DIRCAP/file.txt local/` -> `local/file.txt` * (D2) `cp -r DIRCAP/file.txt local/missing` -> `local/missing` * (E1) `cp -r FILECAP local/` -> "error, you must specify a destination filename" * (E2) `cp -r FILECAP local/missing` -> `local/missing` * note the target's trailing slash is optional: `local/` and `local` behave the same way * trunk (e73d76e) * (F1) `cp -r PARENTCAP/dir local/` -> `local/dir/file.txt` * (F2) `cp -r PARENTCAP/dir local/missing` -> ? * (G1) `cp -r DIRCAP local/` -> (exception) * (G2) `cp -r DIRCAP local/missing` -> (exception?) * (H1) `cp -r DIRCAP_ALIAS: local/` -> (exception) * (H2) `cp -r DIRCAP_ALIAS: local/missing` -> (exception?) * (I1) `cp -r DIRCAP/file.txt local/` -> `local/file.txt` * (I2) `cp -r DIRCAP/file.txt local/missing` -> `local/missing` * (J1) `cp -r FILECAP local/` -> "error, you must specify a destination filename" * (J2) `cp -r FILECAP local/missing` -> `local/missing`
Author

Here's a proposal:

We determine whether the source means the bag, or the contents of the bag, according to this rule:

  • If the source comes with a name, then it means the bag. If it comes with no name, then it means the contents of the bag.

Note that the question of whether the source means the bag or the contents of the bag is not influenced by whether the target exists or doesn't exist.

This is another way of expressing proposal 1 from comment:398053.

Here's a proposal: We determine whether the source means the bag, or the contents of the bag, according to this rule: * If the source comes with a name, then it means the bag. If it comes with no name, then it means the contents of the bag. Note that the question of whether the source means the bag or the contents of the bag is not influenced by whether the target exists or doesn't exist. This is another way of expressing proposal 1 from [comment:398053](/tahoe-lafs/trac/issues/2329#issuecomment-398053).

I'm convinced globbing is too complicated if it evolves towards emulating bash. The key feature I was interested in comment:398057 was an explicit consistent way to disambiguate between container and contents.

So this could also be a --contents flag, or another non-globby-looking symbol, such as the presence of a trailing slash (which I believe warner suggested elsewhere).

Examples:

  • tahoe cp -r "$X" dest/ # Copy the bag $X to dest/$NAME if $X has a name, otherwise fail with an error.
  • tahoe cp -r "$X/" dest/ # Copy the contents of $X into ./dest (the name of $X is irrelevant).

Note that this can be orthogonal to whether or not dest/ exists.

Some semiconcrete examples:

  • tahoe cp -r myalias: foo/ # Error: "myalias:" has no name. To copy the contents into foo/ append a /

  • tahoe cp -r myalias:/ foo/ # foo will contain the contents of myalias after this.

  • tahoe cp -r URI:DIR2... foo/ # Error: a dircap has no name, to copy the contents, append a /

  • tahoe cp -r URI:DIR2.../ foo # Copy the contents of the cap into foo.

  • tahoe cp -r URI:DIR2.../blah foo # ./foo/blah/ will contain the contents.

  • tahoe cp -r URI:DIR2.../blah/ foo # ./foo will contain the contents.

I'm convinced globbing is too complicated if it evolves towards emulating bash. The key feature I was interested in [comment:398057](/tahoe-lafs/trac/issues/2329#issuecomment-398057) was an explicit consistent way to disambiguate between container and contents. So this could also be a ``--contents`` flag, or another non-globby-looking symbol, such as the presence of a trailing slash (which I believe warner suggested elsewhere). Examples: * tahoe cp -r "$X" dest/ # Copy the bag $X to dest/$NAME if $X has a name, otherwise fail with an error. * tahoe cp -r "$X/" dest/ # Copy the contents of $X into ./dest (the name of $X is irrelevant). Note that this can be orthogonal to whether or not dest/ exists. Some semiconcrete examples: * tahoe cp -r myalias: foo/ # Error: "myalias:" has no name. To copy the contents into foo/ append a / * tahoe cp -r myalias:/ foo/ # foo will contain the contents of myalias after this. * tahoe cp -r URI:DIR2... foo/ # Error: a dircap has no name, to copy the contents, append a / * tahoe cp -r URI:DIR2.../ foo # Copy the contents of the cap into foo. * tahoe cp -r URI:DIR2.../blah foo # ./foo/blah/ will contain the contents. * tahoe cp -r URI:DIR2.../blah/ foo # ./foo will contain the contents.
Author

Here's my attempt to fill out the table from comment:398058 for a certain rule that I have in my mind right now (written below).

  • "Rule comment:-1"
  • (F1) cp -r PARENTCAP/dir local/ -> local/dir/file.txt
  • (F2) cp -r PARENTCAP/dir local/missing -> local/missing/dir/file.txt
  • (G1) cp -r DIRCAP local/ -> local/file.txt
  • (G2) cp -r DIRCAP local/missing -> local/missing/file.txt
  • (H1) cp -r DIRCAP_ALIAS: local/ -> local/file.txt
  • (H2) cp -r DIRCAP_ALIAS: local/missing -> local/missing/file.txt
  • (I1) cp -r DIRCAP/file.txt local/ -> local/file.txt
  • (I2) cp -r DIRCAP/file.txt local/missing -> local/missing
  • (J1) cp -r FILECAP local/ -> "error, you must specify a destination filename"
  • (J2) cp -r FILECAP local/missing -> local/missing

"Rule comment:-1" is:

  1. If the source is a directory:

  2. If the target is the name of a locally existing file, then "error: there is already a local file present under the name $TARGET".

  3. If the target is the name of something not locally existing, then mkdir it and then use it as "target directory".

  4. If the target is the name of a locally existing directory, then proceed to use it as "target directory".

  5. Check whether the source directory has a name (as in F1, F2) or has no name (as in G1, G2, H1, H2). If it has a name then we say that the source means the bag itself — the directory, and if it has no name then we say that the source means the contents of the bag — the contents of the directory.

  6. Now if the source is the bag itself, then mkdir a new directory inside "target directory", named by the name of the source directory, and copy the contents of the bag into "target directory"/"source directory name"/ (which are cases F1 and F2).

  7. Else (the source was the contents of the bag instead of the bag itself) copy the contents of the bag into "target directory"/ (which are cases G1, G2, H1, and H2).

  8. If the source is a file, then check if the target is an existing directory.

  9. If the source is a nameless file (as in J1, J2) and target is an existing directory (as in J1), then "error, you must specify a destination filename".

  10. Else, if the source is a nameless file and the target is not an existing directory, then use the target as the local filename (which is case J2).

  11. Else, if the source is a named file and the target is an existing directory, then use the source filename within the target existing directory (which is case I1).

  12. Else, if the source is a named file and the target is not an existing directory, then use the target as the local filename (which is case I2).

Here's my attempt to fill out the table from [comment:398058](/tahoe-lafs/trac/issues/2329#issuecomment-398058) for a certain rule that I have in my mind right now (written below). * "Rule [comment:-1](/tahoe-lafs/trac/issues/2329#issuecomment--1)" * (F1) `cp -r PARENTCAP/dir local/` -> `local/dir/file.txt` * (F2) `cp -r PARENTCAP/dir local/missing` -> `local/missing/dir/file.txt` * (G1) `cp -r DIRCAP local/` -> `local/file.txt` * (G2) `cp -r DIRCAP local/missing` -> `local/missing/file.txt` * (H1) `cp -r DIRCAP_ALIAS: local/` -> `local/file.txt` * (H2) `cp -r DIRCAP_ALIAS: local/missing` -> `local/missing/file.txt` * (I1) `cp -r DIRCAP/file.txt local/` -> `local/file.txt` * (I2) `cp -r DIRCAP/file.txt local/missing` -> `local/missing` * (J1) `cp -r FILECAP local/` -> "error, you must specify a destination filename" * (J2) `cp -r FILECAP local/missing` -> `local/missing` "Rule [comment:-1](/tahoe-lafs/trac/issues/2329#issuecomment--1)" is: 1. If the source is a directory: 1. If the target is the name of a locally existing file, then "error: there is already a local file present under the name $TARGET". 2. If the target is the name of something not locally existing, then mkdir it and then use it as "target directory". 3. If the target is the name of a locally existing directory, then proceed to use it as "target directory". 4. Check whether the source directory has a name (as in F1, F2) or has no name (as in G1, G2, H1, H2). If it has a name then we say that the source means the bag itself — the directory, and if it has no name then we say that the source means the contents of the bag — the contents of the directory. 1. Now if the source is the bag itself, then mkdir a new directory inside "target directory", named by the name of the source directory, and copy the contents of the bag into "target directory"/"source directory name"/ (which are cases F1 and F2). 2. Else (the source was the contents of the bag instead of the bag itself) copy the contents of the bag into "target directory"/ (which are cases G1, G2, H1, and H2). 2. If the source is a file, then check if the target is an existing directory. 1. If the source is a nameless file (as in J1, J2) *and* target is an existing directory (as in J1), then "error, you must specify a destination filename". 2. Else, if the source is a nameless file and the target is not an existing directory, then use the target as the local filename (which is case J2). 3. Else, if the source is a named file and the target is an existing directory, then use the source filename within the target existing directory (which is case I1). 4. Else, if the source is a named file and the target is not an existing directory, then use the target as the local filename (which is case I2).
Author

"Rule comment:398061" could in the future be extended by additional syntax to indicate that the user wants to copy the contents-of-the-bag instead of the bag, in those cases where the bag had a name. comment:398060 suggests such additional syntax. (Side note: I have been confused in the past by the presence-or-absence-of-trailing-slash, such as rsync uses, to indicate this sort of thing. I'd prefer a very long and explicit thing like a command-line switch --contents-of.)

"Rule [comment:398061](/tahoe-lafs/trac/issues/2329#issuecomment-398061)" could in the future be extended by additional syntax to indicate that the user wants to copy the contents-of-the-bag instead of the bag, in those cases where the bag had a name. [comment:398060](/tahoe-lafs/trac/issues/2329#issuecomment-398060) suggests such additional syntax. (Side note: I have been confused in the past by the presence-or-absence-of-trailing-slash, such as rsync uses, to indicate this sort of thing. I'd prefer a very long and explicit thing like a command-line switch `--contents-of`.)

Another argument against globbing is that the argument would have to be quoted -- and if it were not, strange things would happen on Unix (I think the argument would appear to be omitted assuming there is no local file that matches the glob).

Another argument against globbing is that the argument would have to be quoted -- and if it were not, strange things would happen on Unix (I think the argument would appear to be omitted assuming there is no local file that matches the glob).

Ok, here's the current state of affairs:

  • cp -r X local/, where local already exists:
X 1.10 trunk(e73d76e) new?
PARENTCAP/dir (A1) local/file (F1) local/dir/file (F3)
DIRCAP (B1) local/file (G1) EXCEPTION-1 (G3)
DIRCAP_ALIAS: (C1) local/file (H1) EXCEPTION-1 (H3)
-
DIRCAP/file (D1) local/file (I1) local/file (I3)
FILECAP (E1) ERROR-2 (J1) ERROR-2 (J3)
  • cp -r X local/missing, where local exists but missing does not:
X 1.10 trunk(e73d76e) /bin/cp -r new?
PARENTCAP/dir (A2) local/missing/file (F2) local/missing/dir/file local/missing/file (F4)
DIRCAP (B2) local/missing/file (G2) EXCEPTION-1 (G4)
DIRCAP_ALIAS: (C2) local/missing/file (H2) EXCEPTION-1 (H4)
-
DIRCAP/file (D2) local/missing/file (I2) local/missing/file local/missing (I4)
FILECAP (E2) EXCEPTION-3 (J2) EXCEPTION-3 (J4)
  • EXCEPTION-1: build_graphs(), NoneType has no attribute startswith
  • ERROR-2: error: you must specify a destination filename
  • EXCEPTION-3: put_file() line 156, name is None but precondition requires isinstance(unicode)
Ok, here's the current state of affairs: * `cp -r X local/`, where `local` already exists: | X | 1.10 | trunk(e73d76e) | new? | |---|---|---|---| | PARENTCAP/dir | (A1) local/file | (F1) local/dir/file | (F3) | | DIRCAP | (B1) local/file | (G1) EXCEPTION-1 | (G3) | | DIRCAP_ALIAS: | (C1) local/file | (H1) EXCEPTION-1 | (H3) | | - | | | | | DIRCAP/file | (D1) local/file | (I1) local/file | (I3) | | FILECAP | (E1) ERROR-2 | (J1) ERROR-2 | (J3) | * `cp -r X local/missing`, where `local` exists but `missing` does not: | X | 1.10 | trunk(e73d76e) | /bin/cp -r | new? | |---|---|---|---|---| | PARENTCAP/dir | (A2) local/missing/file | (F2) local/missing/dir/file | local/missing/file | (F4) | | DIRCAP | (B2) local/missing/file | (G2) EXCEPTION-1 | | (G4) | | DIRCAP_ALIAS: | (C2) local/missing/file | (H2) EXCEPTION-1 | | (H4) | | - | | | | | | DIRCAP/file | (D2) local/missing/file | (I2) local/missing/file | local/missing | (I4) | | FILECAP | (E2) EXCEPTION-3 | (J2) EXCEPTION-3 | | (J4) | * EXCEPTION-1: `build_graphs()`, `NoneType has no attribute startswith` * ERROR-2: `error: you must specify a destination filename` * EXCEPTION-3: `put_file()` line 156, `name` is None but precondition requires `isinstance(unicode)`

I think zooko's rule in comment:398061 / comment:-1 gives us:

  • cp -r X local/, where local already exists:
X 1.10 trunk(e73d76e) rule [comment:398061](/tahoe-lafs/trac/issues/2329#issuecomment--1)
PARENTCAP/dir (A1) local/file (F1) local/dir/file (F3) local/dir/file
DIRCAP (B1) local/file (G1) EXCEPTION-1 (G3) local/file
DIRCAP_ALIAS: (C1) local/file (H1) EXCEPTION-1 (H3) local/file
-
DIRCAP/file (D1) local/file (I1) local/file (I3) local/file
FILECAP (E1) ERROR-2 (J1) ERROR-2 (J3) ERROR-2
  • cp -r X local/missing, where local exists but missing does not:
X 1.10 trunk(e73d76e) rule [comment:398061](/tahoe-lafs/trac/issues/2329#issuecomment--1)
PARENTCAP/dir (A2) local/missing/file (F2) local/missing/dir/file (F4) local/missing/dir/file
DIRCAP (B2) local/missing/file (G2) EXCEPTION-1 (G4) local/missing/file
DIRCAP_ALIAS: (C2) local/missing/file (H2) EXCEPTION-1 (H4) local/missing/file
-
DIRCAP/file (D2) local/missing/file (I2) local/missing/file (I4) local/missing
FILECAP (E2) EXCEPTION-3 (J2) EXCEPTION-3 (J4) local/missing

Although:

  • this doesn't cover his rule 1.a, where the source is a directory but the target is a pre-existing file
  • we could probably get away with saying that "cp -r" on a file source is an error, if it made things cleaner (in J3/J4)

Feel free to edit the table in this comment if I interpreted your
proposal incorrectly.

I think zooko's rule in [comment:398061](/tahoe-lafs/trac/issues/2329#issuecomment-398061) / [comment:-1](/tahoe-lafs/trac/issues/2329#issuecomment--1) gives us: * `cp -r X local/`, where `local` already exists: | X | 1.10 | trunk(e73d76e) | rule [[comment:398061](/tahoe-lafs/trac/issues/2329#issuecomment-398061)](/tahoe-lafs/trac/issues/2329#issuecomment--1) | |---|---|---|---| | PARENTCAP/dir | (A1) local/file | (F1) local/dir/file | (F3) local/dir/file | | DIRCAP | (B1) local/file | (G1) EXCEPTION-1 | (G3) local/file | | DIRCAP_ALIAS: | (C1) local/file | (H1) EXCEPTION-1 | (H3) local/file | | - | | | | | DIRCAP/file | (D1) local/file | (I1) local/file | (I3) local/file | | FILECAP | (E1) ERROR-2 | (J1) ERROR-2 | (J3) ERROR-2 | * `cp -r X local/missing`, where `local` exists but `missing` does not: | X | 1.10 | trunk(e73d76e) | rule [[comment:398061](/tahoe-lafs/trac/issues/2329#issuecomment-398061)](/tahoe-lafs/trac/issues/2329#issuecomment--1) | |---|---|---|---| | PARENTCAP/dir | (A2) local/missing/file | (F2) local/missing/dir/file | (F4) local/missing/dir/file | | DIRCAP | (B2) local/missing/file | (G2) EXCEPTION-1 | (G4) local/missing/file | | DIRCAP_ALIAS: | (C2) local/missing/file | (H2) EXCEPTION-1 | (H4) local/missing/file | | - | | | | | DIRCAP/file | (D2) local/missing/file | (I2) local/missing/file | (I4) local/missing | | FILECAP | (E2) EXCEPTION-3 | (J2) EXCEPTION-3 | (J4) local/missing | Although: * this doesn't cover his rule 1.a, where the source is a directory but the target is a pre-existing file * we could probably get away with saying that "cp -r" on a file source is an error, if it made things cleaner (in J3/J4) Feel free to edit the table in this comment if I interpreted your proposal incorrectly.

warner: are you sure the table is right for cp -R DIRCAP/file local/missing, columns 1.10 and trunk? I would have expected the resulting file to be at local/missing.

warner: are you sure the table is right for `cp -R DIRCAP/file local/missing`, columns 1.10 and trunk? I would have expected the resulting file to be at `local/missing`.
Author

My original comment:398061 was badly misformatted which hid some of the structure of my proposed rules. Here it is again, unchanged except for proper formatting.

Here's my attempt to fill out the table from comment:398058 for a certain rule that I have in my mind right now (written below).

  • "Rule comment:398061"
  • (F1) cp -r PARENTCAP/dir local/ -> local/dir/file.txt
  • (F2) cp -r PARENTCAP/dir local/missing -> local/missing/dir/file.txt
  • (G1) cp -r DIRCAP local/ -> local/file.txt
  • (G2) cp -r DIRCAP local/missing -> local/missing/file.txt
  • (H1) cp -r DIRCAP_ALIAS: local/ -> local/file.txt
  • (H2) cp -r DIRCAP_ALIAS: local/missing -> local/missing/file.txt
  • (I1) cp -r DIRCAP/file.txt local/ -> local/file.txt
  • (I2) cp -r DIRCAP/file.txt local/missing -> local/missing
  • (J1) cp -r FILECAP local/ -> "error, you must specify a destination filename"
  • (J2) cp -r FILECAP local/missing -> local/missing

"Rule comment:398061" is:

.1. If the source is a directory:

.a. If the target is the name of a locally existing file, then "error: there is already a local file present under the name $TARGET".

.b. If the target is the name of something not locally existing, then mkdir it and then use it as "target directory".

.c. If the target is the name of a locally existing directory, then proceed to use it as "target directory".

.d. Check whether the source directory has a name (as in F1, F2) or has no name (as in G1, G2, H1, H2). If it has a name then we say that the source means the bag itself — the directory, and if it has no name then we say that the source means the contents of the bag — the contents of the directory.

  .i. Now if the source is the bag itself, then mkdir a new directory inside "target directory", named by the name of the source directory, and copy the contents of the bag into "target directory"/"source directory name"/ (which are cases F1 and F2).

  .ii. Else (the source was the contents of the bag instead of the bag itself) copy the contents of the bag into "target directory"/ (which are cases G1, G2, H1, and H2).

.2. If the source is a file, then check if the target is an existing directory.

.a. If the source is a nameless file (as in J1, J2) and target is an existing directory (as in J1), then "error, you must specify a destination filename".

.b. Else, if the source is a nameless file and the target is not an existing directory, then use the target as the local filename (which is case J2).

.c. Else, if the source is a named file and the target is an existing directory, then use the source filename within the target existing directory (which is case I1).

.d. Else, if the source is a named file and the target is not an existing directory, then use the target as the local filename (which is case I2).

My original [comment:398061](/tahoe-lafs/trac/issues/2329#issuecomment-398061) was badly misformatted which hid some of the structure of my proposed rules. Here it is again, unchanged except for proper formatting. Here's my attempt to fill out the table from [comment:398058](/tahoe-lafs/trac/issues/2329#issuecomment-398058) for a certain rule that I have in my mind right now (written below). * "Rule [comment:398061](/tahoe-lafs/trac/issues/2329#issuecomment-398061)" * (F1) `cp -r PARENTCAP/dir local/` -> `local/dir/file.txt` * (F2) `cp -r PARENTCAP/dir local/missing` -> `local/missing/dir/file.txt` * (G1) `cp -r DIRCAP local/` -> `local/file.txt` * (G2) `cp -r DIRCAP local/missing` -> `local/missing/file.txt` * (H1) `cp -r DIRCAP_ALIAS: local/` -> `local/file.txt` * (H2) `cp -r DIRCAP_ALIAS: local/missing` -> `local/missing/file.txt` * (I1) `cp -r DIRCAP/file.txt local/` -> `local/file.txt` * (I2) `cp -r DIRCAP/file.txt local/missing` -> `local/missing` * (J1) `cp -r FILECAP local/` -> "error, you must specify a destination filename" * (J2) `cp -r FILECAP local/missing` -> `local/missing` "Rule [comment:398061](/tahoe-lafs/trac/issues/2329#issuecomment-398061)" is: .1. If the source is a directory: .a. If the target is the name of a locally existing file, then "error: there is already a local file present under the name $TARGET". .b. If the target is the name of something not locally existing, then mkdir it and then use it as "target directory". .c. If the target is the name of a locally existing directory, then proceed to use it as "target directory". .d. Check whether the source directory has a name (as in F1, F2) or has no name (as in G1, G2, H1, H2). If it has a name then we say that the source means the bag itself — the directory, and if it has no name then we say that the source means the contents of the bag — the contents of the directory. .i. Now if the source is the bag itself, then mkdir a new directory inside "target directory", named by the name of the source directory, and copy the contents of the bag into "target directory"/"source directory name"/ (which are cases F1 and F2). .ii. Else (the source was the contents of the bag instead of the bag itself) copy the contents of the bag into "target directory"/ (which are cases G1, G2, H1, and H2). .2. If the source is a file, then check if the target is an existing directory. .a. If the source is a nameless file (as in J1, J2) *and* target is an existing directory (as in J1), then "error, you must specify a destination filename". .b. Else, if the source is a nameless file and the target is not an existing directory, then use the target as the local filename (which is case J2). .c. Else, if the source is a named file and the target is an existing directory, then use the source filename within the target existing directory (which is case I1). .d. Else, if the source is a named file and the target is not an existing directory, then use the target as the local filename (which is case I2).
Author

Replying to warner:

  • we could probably get away with saying that "cp -r" on a file source is an error, if it made things cleaner (in J3/J4)

That sounds okay to me.

Feel free to edit the table in this comment if I interpreted your proposal incorrectly.

I think the table is an accurate reflection of the comment:398061 / comment:398067 proposal.

Replying to [warner](/tahoe-lafs/trac/issues/2329#issuecomment-398065): > * we could probably get away with saying that "cp -r" on a file source is an error, if it made things cleaner (in J3/J4) That sounds okay to me. > Feel free to edit the table in this comment if I interpreted your proposal incorrectly. I think the table is an accurate reflection of the [comment:398061](/tahoe-lafs/trac/issues/2329#issuecomment-398061) / [comment:398067](/tahoe-lafs/trac/issues/2329#issuecomment-398067) proposal.

Note that this could potentially interact with #2027.

Note that this could potentially interact with #2027.

Replying to daira:

warner: are you sure the table (in comment:398064) is right for cp -R DIRCAP/file local/missing, columns 1.10 and trunk? I would have expected the resulting file to be at local/missing.

Ping in case you missed this question.

Replying to [daira](/tahoe-lafs/trac/issues/2329#issuecomment-398066): > warner: are you sure the table (in [comment:398064](/tahoe-lafs/trac/issues/2329#issuecomment-398064)) is right for `cp -R DIRCAP/file local/missing`, columns 1.10 and trunk? I would have expected the resulting file to be at `local/missing`. Ping in case you missed this question.

D2 and I2, right? Yeah, those give local/missing/file.txt in both cases.

D2 and I2, right? Yeah, those give local/missing/file.txt in both cases.

Ok, I agree that that's a bit weird. /bin/cp doesn't do that: /bin/cp parent/dir/file.txt local/missing creates local/missing, and /bin/cp -r does the same thing.

I guess I need to add table entries for what unix does. If possible/applicable, we should match unix behavior.

Ok, I agree that that's a bit weird. `/bin/cp` doesn't do that: `/bin/cp parent/dir/file.txt local/missing` creates `local/missing`, and `/bin/cp -r` does the same thing. I guess I need to add table entries for what unix does. If possible/applicable, we should match unix behavior.

I will try to implement zooko's algorithm from comment:398067 , and enhance the table to mention what happens with /bin/cp in both no-flag, -r, and -R cases.

I will try to implement zooko's algorithm from [comment:398067](/tahoe-lafs/trac/issues/2329#issuecomment-398067) , and enhance the table to mention what happens with `/bin/cp` in both no-flag, `-r`, and `-R` cases.

We discussed this during Nuts and Bolts, and I was persuaded that we should Zooko's comment:398067 algorithm despite the difference from /bin/cp (as tested on OS X). The clinching arguments were:

  • /bin/cp doesn't behave consistently across platforms anyway. Its different treatment of a trailing slash on some platforms is confusing and I don't think we should emulate that.
  • Zooko's proposed algorithm has a symmetry between the target-present and target-not-present cases that I hadn't previously noticed, and that may help to prevent race conditions.
We discussed this during Nuts and Bolts, and I was persuaded that we should Zooko's [comment:398067](/tahoe-lafs/trac/issues/2329#issuecomment-398067) algorithm despite the difference from `/bin/cp` (as tested on OS X). The clinching arguments were: * `/bin/cp` doesn't behave consistently across platforms anyway. Its different treatment of a trailing slash on some platforms is confusing and I don't think we should emulate that. * Zooko's proposed algorithm has a symmetry between the target-present and target-not-present cases that I hadn't previously noticed, and that may help to prevent race conditions.

Updated table for cp [-r] X local/, where local already exists:

|

/bin/cp - local/file ERROR-4b - -
/bin/cp -r - local/file local/dir/file - -
/bin/cp -R - local/file local/dir/file - -
1.10 ERROR-2 local/file local/file ERROR-4 ERROR-4
1.10 -r ERROR-2 local/file local/file local/file local/file
trunk ERROR-2 local/file local/file ERROR-4 ERROR-4
trunk -r ERROR-2 local/file local/dir/file EXCEPTION-1 EXCEPTION-1
comment:398067 ERROR-2 local/file ERROR-4 ERROR-4 ERROR-4
comment:398067 -r ERROR-2 local/file local/dir/file local/file local/file

And for cp [-r] X local/missing, where local exists but missing does not:

|

/bin/cp - local/missing ERROR-4b - -
/bin/cp -r - local/missing local/missing/file - -
/bin/cp -R - local/missing local/missing/file - -
1.10 local/missing local/missing ERROR-4 ERROR-4 ERROR-4
1.10 -r EXCEPTION-3 local/missing/file local/missing/file local/missing/file local/missing/file
trunk local/missing local/missing ERROR-4 ERROR-4 ERROR-4
trunk -r EXCEPTION-3 local/missing/file local/missing/dir/file EXCEPTION-1 EXCEPTION-1
comment:398067 local/missing local/missing ERROR-4 ERROR-4 ERROR-4
comment:398067 -r local/missing local/missing local/missing/dir/file local/missing/file local/missing/file
  • EXCEPTION-1: build_graphs(), NoneType has no attribute startswith
  • ERROR-2: you must specify a destination filename
  • EXCEPTION-3: put_file() line 156, name is None but precondition requires isinstance(unicode)
  • ERROR-4: cannot copy directories without --recursive
  • ERROR-4b: X is a directory (not copied)
Updated table for `cp [-r] X local/`, where `local` already exists: # | | | | | | | | | |---|---|---|---|---|---|---| | /bin/cp | - | local/file | | ERROR-4b | - | - | | /bin/cp -r | - | local/file | | local/dir/file | - | - | | /bin/cp -R | - | local/file | | local/dir/file | - | - | | 1.10 | ERROR-2 | local/file | | local/file | ERROR-4 | ERROR-4 | | 1.10 -r | ERROR-2 | local/file | | local/file | local/file | local/file | | trunk | ERROR-2 | local/file | | local/file | ERROR-4 | ERROR-4 | | trunk -r | ERROR-2 | local/file | | local/dir/file | EXCEPTION-1 | EXCEPTION-1 | | [comment:398067](/tahoe-lafs/trac/issues/2329#issuecomment-398067) | ERROR-2 | local/file | | ERROR-4 | ERROR-4 | ERROR-4 | | [comment:398067](/tahoe-lafs/trac/issues/2329#issuecomment-398067) -r | ERROR-2 | local/file | | local/dir/file | local/file | local/file | And for `cp [-r] X local/missing`, where `local` exists but `missing` does not: # | | | | | | | | | |---|---|---|---|---|---|---| | /bin/cp | - | local/missing | | ERROR-4b | - | - | | /bin/cp -r | - | local/missing | | local/missing/file | - | - | | /bin/cp -R | - | local/missing | | local/missing/file | - | - | | 1.10 | local/missing | local/missing | | ERROR-4 | ERROR-4 | ERROR-4 | | 1.10 -r | EXCEPTION-3 | local/missing/file | | local/missing/file | local/missing/file | local/missing/file | | trunk | local/missing | local/missing | | ERROR-4 | ERROR-4 | ERROR-4 | | trunk -r | EXCEPTION-3 | local/missing/file | | local/missing/dir/file | EXCEPTION-1 | EXCEPTION-1 | | [comment:398067](/tahoe-lafs/trac/issues/2329#issuecomment-398067) | local/missing | local/missing | | ERROR-4 | ERROR-4 | ERROR-4 | | [comment:398067](/tahoe-lafs/trac/issues/2329#issuecomment-398067) -r | local/missing | local/missing | | local/missing/dir/file | local/missing/file | local/missing/file | * EXCEPTION-1: `build_graphs()`, `NoneType has no attribute startswith` * ERROR-2: you must specify a destination filename * EXCEPTION-3: `put_file()` line 156, `name` is None but precondition requires `isinstance(unicode)` * ERROR-4: cannot copy directories without --recursive * ERROR-4b: X is a directory (not copied)

I updated comment:398075 with the proposed behaviour from comment:398067. There is one case without -r that I didn't know how to fill in: tahoe cp PARENTCAP/dir local/. (Either local/file or ERROR-4b are reasonable possibilities.)

I updated [comment:398075](/tahoe-lafs/trac/issues/2329#issuecomment-398075) with the proposed behaviour from [comment:398067](/tahoe-lafs/trac/issues/2329#issuecomment-398067). There is one case without `-r` that I didn't know how to fill in: `tahoe cp PARENTCAP/dir local/`. (Either `local/file` or ERROR-4b are reasonable possibilities.)

In TC&C, we agreed that tahoe cp PARENTCAP/dir local/ should also give ERROR-4.

In TC&C, we agreed that `tahoe cp PARENTCAP/dir local/` should also give ERROR-4.

I've updated comment:398075 to reflect that (the rule is that you must give -r to copy a directory, so a directory-like source without -r gives an error). I think our table is now up to date.

Looking at the table, with an eye towards writing docs that explain what has changed, the new "cp -r PARENTCAP/dir local/missing" case (F2, bottom row) stands out. It's consistent with current trunk, but not with 1.10, or the proposed behavior for other directory-like sources, or with bin/cp. It'd be easier to explain if it were local/missing/file instead. I'm sure we've discussed this to death.. I've been too busy figuring out how to format that table. I'll reread the ticket and re-understand the rationale for that one.

Next steps:

  • try to make the code implement the table
  • put an edited form of the table into NEWS, to explain the user-visible change
  • put a smaller form (just bin/cp and current behavior) into cli.rst
  • put an even smaller form (just current behavior, maybe as prose) into the tahoe-cp --help docstring
I've updated [comment:398075](/tahoe-lafs/trac/issues/2329#issuecomment-398075) to reflect that (the rule is that you must give -r to copy a directory, so a directory-like source without -r gives an error). I think our table is now up to date. Looking at the table, with an eye towards writing docs that explain what has changed, the new "cp -r PARENTCAP/dir local/missing" case (F2, bottom row) stands out. It's consistent with current trunk, but not with 1.10, or the proposed behavior for other directory-like sources, or with bin/cp. It'd be easier to explain if it were `local/missing/file` instead. I'm sure we've discussed this to death.. I've been too busy figuring out how to format that table. I'll reread the ticket and re-understand the rationale for that one. Next steps: * try to make the code implement the table * put an edited form of the table into NEWS, to explain the user-visible change * put a smaller form (just bin/cp and current behavior) into cli.rst * put an even smaller form (just current behavior, maybe as prose) into the tahoe-cp `--help` docstring
Author

Replying to warner:

Looking at the table, with an eye towards writing docs that explain what has changed, the new "cp -r PARENTCAP/dir local/missing" case (F2, bottom row) stands out. It's consistent with current trunk, but not with 1.10, or the proposed behavior for other directory-like sources, or with bin/cp. It'd be easier to explain if it were local/missing/file instead. I'm sure we've discussed this to death..

Let's see…

That is intentional in the comment:398067 algorithm. The reasoning is twofold:

First of all, the question of whether you want the bag vs. the contents of the bag is determined by whether the directory-like source has a name (the F column) vs. doesn't have a name (the G and H columns). That's a nice simple rule, and according to that, the result in the "comment:398067 -r" row has to be local/missing/dir/file instead of local/missing/file, because the latter would be just the contents of the bag (file) instead of the bag (dir/file).

So looking at the table, the cells of column F need to result in dir/file (if they aren't instead an error) and the cells of columns G and H need to result in file (if they aren't instead an error).

Second, the comment:398067 algorithm behaves the same way whether the target exists or doesn't exist at the beginning of the algorithm. This is (in my intuition) a nice simple rule, and it also means there isn't a race condition in which the behavior is unpredictable because the existence of the target is unpredictable.

So looking at the table, that means the result of F1 and F2 both need to result in the same behavior as each other.

I'm not saying this rationale is better than other rationales that would justify other designs (such as “This is as much like /bin/cp as we could make it.”, or “The behavior is the same for all directory-like sources.”), but that's the rationale for this design.

  • try to make the code implement the table

Yay!

  • put an edited form of the table into NEWS, to explain the user-visible change

Yay!

  • put a smaller form (just bin/cp and current behavior) into cli.rst

Yay!

  • put an even smaller form (just current behavior, maybe as prose) into the tahoe-cp --help docstring

Yay!

Thank you for your good work on this.

Replying to [warner](/tahoe-lafs/trac/issues/2329#issuecomment-398078): > > Looking at the table, with an eye towards writing docs that explain what has changed, the new "cp -r PARENTCAP/dir local/missing" case (F2, bottom row) stands out. It's consistent with current trunk, but not with 1.10, or the proposed behavior for other directory-like sources, or with bin/cp. It'd be easier to explain if it were `local/missing/file` instead. I'm sure we've discussed this to death.. Let's see… That is intentional in the [comment:398067](/tahoe-lafs/trac/issues/2329#issuecomment-398067) algorithm. The reasoning is twofold: First of all, the question of whether you want the bag vs. the contents of the bag is determined by whether the directory-like source has a name (the `F` column) vs. doesn't have a name (the `G` and `H` columns). That's a nice simple rule, and according to that, the result in the "[comment:398067](/tahoe-lafs/trac/issues/2329#issuecomment-398067) -r" row has to be `local/missing/dir/file` instead of `local/missing/file`, because the latter would be just the contents of the bag (`file`) instead of the bag (`dir/file`). So looking at [the table](/tahoe-lafs/trac/issues/2329#issuecomment-398075), the cells of column `F` need to result in `dir/file` (if they aren't instead an error) and the cells of columns `G` and `H` need to result in `file` (if they aren't instead an error). Second, the [comment:398067](/tahoe-lafs/trac/issues/2329#issuecomment-398067) algorithm behaves the same way whether the target exists or doesn't exist at the beginning of the algorithm. This is (in my intuition) a nice simple rule, and it also means there isn't a race condition in which the behavior is unpredictable because the existence of the target is unpredictable. So looking at the table, that means the result of `F1` and `F2` both need to result in the same behavior as each other. I'm not saying this rationale is better than other rationales that would justify other designs (such as “This is as much like `/bin/cp` as we could make it.”, or “The behavior is the same for all directory-like sources.”), but that's the rationale for this design. > * try to make the code implement the table Yay! > * put an edited form of the table into NEWS, to explain the user-visible change Yay! > * put a smaller form (just bin/cp and current behavior) into cli.rst Yay! > * put an even smaller form (just current behavior, maybe as prose) into the tahoe-cp `--help` docstring Yay! ☺ Thank you for your good work on this.

I've got a branch which adds a test that exercises the full table. While studying how to change the code to let that test pass, I came across another wrinkle: cp accepts multiple source arguments.

In general, if you have multiple source arguments, then the target must be a directory. If the target is a directory, then you can't use unnamed files as sources (one or multiple). The only case that accepts an unnamed file as a source is when you're copying exactly one of them to a target that is (or will be) a file.

Here's a list of what I think should happen (I tried to compress some of the cases.. let me know if it doesn't seem to cover everything):

  • sources are NAMEDDIR, UNNAMEDDIR, NAMEDFILE, UNNAMEDFILE
  • targets are DIR, FILE, or MISSING
  • single-source cases:
  • cp FILE TO-FILE: replace the contents
  • cp FILE TO-MISSING: create the target file
  • cp NAMEDFILE TO-DIR: create/replace TO-DIR/filename
  • cp UNNAMEDFILE TO-DIR: error: need a name
  • (cp -r FILE X: behave same as without -r)
  • cp DIR X: error: must use -r if any source is a directory
  • cp -r NAMEDDIR TO-DIR: create TO-DIR/NAME/ and fill with contents
  • cp -r NAMEDDIR TO-MISSING: same: TO-MISSING/NAME/ filled with contents
  • cp -r UNNAMEDDIR TO-DIR: copy source/* into TO/*
  • cp -r UNNAMEDDIR TO-MISSING: same: mkdir TO-MISSING, fill with contents
  • multiple-source cases:
  • cp X.. TO-FILE: error: many-to-one requires target is a directory
  • cp NAMEDFILES.. TO-DIR: create/replace TO-DIR/filenames
  • cp NAMEDFILES.. TO-MISSING: mkdir, then treat like TO-DIR
  • cp UNNAMEDFILES.. X: error: need a name (1 source is ok, but not >1)
  • cp FILESDIRS.. X: error: must use -r if any source is a directory
  • cp -r X.. TO-MISSING: mkdir target, then treat as TO-DIR
  • cp -r X.. TO-DIR:
  • if X is UNNAMEDFILE: error, need a name
  • if X is NAMEDFILE: create/replace TO-DIR/name
  • if X is UNNAMEDDIR: copy source/* into TO/*, like with single-source
  • if X is NAMEDDIR: copy source/* into TO/name/*

Next step is to figure out how to turn this into a flowchart for tahoe_cp.Copier.try_copy.. I've started on the internal refactorings to make this easier (I was wrong before when I thought the basename should be tracked from outside of TahoeFileSource/etc.. treating it as a possibly-empty property of the source instance is totally the right way to do it).

I've got a branch which adds a test that exercises the full table. While studying how to change the code to let that test pass, I came across another wrinkle: `cp` accepts multiple source arguments. In general, if you have multiple source arguments, then the target must be a directory. If the target is a directory, then you can't use unnamed files as sources (one or multiple). The only case that accepts an unnamed file as a source is when you're copying exactly one of them to a target that is (or will be) a file. Here's a list of what I think should happen (I tried to compress some of the cases.. let me know if it doesn't seem to cover everything): * sources are NAMEDDIR, UNNAMEDDIR, NAMEDFILE, UNNAMEDFILE * targets are DIR, FILE, or MISSING * single-source cases: * cp FILE TO-FILE: replace the contents * cp FILE TO-MISSING: create the target file * cp NAMEDFILE TO-DIR: create/replace TO-DIR/filename * cp UNNAMEDFILE TO-DIR: error: need a name * (cp -r FILE X: behave same as without -r) * cp DIR X: error: must use -r if any source is a directory * cp -r NAMEDDIR TO-DIR: create TO-DIR/NAME/ and fill with contents * cp -r NAMEDDIR TO-MISSING: same: TO-MISSING/NAME/ filled with contents * cp -r UNNAMEDDIR TO-DIR: copy source/* into TO/* * cp -r UNNAMEDDIR TO-MISSING: same: mkdir TO-MISSING, fill with contents * multiple-source cases: * cp X.. TO-FILE: error: many-to-one requires target is a directory * cp NAMEDFILES.. TO-DIR: create/replace TO-DIR/filenames * cp NAMEDFILES.. TO-MISSING: mkdir, then treat like TO-DIR * cp UNNAMEDFILES.. X: error: need a name (1 source is ok, but not >1) * cp FILESDIRS.. X: error: must use -r if any source is a directory * cp -r X.. TO-MISSING: mkdir target, then treat as TO-DIR * cp -r X.. TO-DIR: * if X is UNNAMEDFILE: error, need a name * if X is NAMEDFILE: create/replace TO-DIR/name * if X is UNNAMEDDIR: copy source/* into TO/*, like with single-source * if X is NAMEDDIR: copy source/* into TO/name/* Next step is to figure out how to turn this into a flowchart for `tahoe_cp.Copier.try_copy`.. I've started on the internal refactorings to make this easier (I was wrong before when I thought the basename should be tracked from outside of `TahoeFileSource`/etc.. treating it as a possibly-empty property of the source instance is totally the right way to do it).

You're missing a case:

  • cp NAMEDANDUNNAMEDFILES.. X: error: need a name (if there is >1 source of which >=1 is unnamed)
You're missing a case: * `cp NAMEDANDUNNAMEDFILES.. X`: error: need a name (if there is >1 source of which >=1 is unnamed)

Similarly for cp -R X.. TO-DIR:

  • if X has >=1 UNNAMEDFILE: error, need a name
  • otherwise for each X,
    • if X is NAMEDFILE: create/replace TO-DIR/name
    • if X is UNNAMEDDIR: copy source/* into TO-DIR/*, like with single-source
    • if X is NAMEDDIR: copy source/* into TO-DIR/name/*
Similarly for `cp -R X.. TO-DIR`: * if X has >=1 UNNAMEDFILE: error, need a name * otherwise *for each* X, * if X is NAMEDFILE: create/replace TO-DIR/name * if X is UNNAMEDDIR: copy source/* into TO-DIR/*, like with single-source * if X is NAMEDDIR: copy source/* into TO-DIR/name/*

Ok, updates:

  • sources are NAMEDDIR, UNNAMEDDIR, NAMEDFILE, UNNAMEDFILE
  • targets are DIR, FILE, or MISSING
  • single-source cases:
  • cp FILE TO-FILE: replace the contents
  • cp FILE TO-MISSING: create the target file
  • cp NAMEDFILE TO-DIR: create/replace TO-DIR/filename
  • cp UNNAMEDFILE TO-DIR: error: need a name
  • (cp -r FILE X: behave same as without -r)
  • cp DIR X: error: must use -r if any source is a directory
  • cp -r DIR TO-FILE: error, directories must be copied into other directories
  • cp -r NAMEDDIR TO-DIR: create TO-DIR/NAME/ and fill with contents
  • cp -r NAMEDDIR TO-MISSING: same: TO-MISSING/NAME/ filled with contents
  • cp -r UNNAMEDDIR TO-DIR: copy source/* into TO/*
  • cp -r UNNAMEDDIR TO-MISSING: same: mkdir TO-MISSING, fill with contents
  • multiple-source cases:
  • cp X.. TO-FILE: error: many-to-one requires target is a directory
  • cp NAMEDFILES.. TO-DIR: create/replace TO-DIR/filenames
  • cp NAMEDFILES.. TO-MISSING: mkdir, then treat like TO-DIR
  • cp SOMEUNNAMEDFILES.. X: error: need a name
  • (cp UNNAMEDFILE X with 1 source is ok, but not if there are multiple sources)
  • cp FILESDIRS.. X: error: must use -r if any source is a directory
  • cp -r X.. TO-MISSING: mkdir target, then treat as TO-DIR
  • cp -r X.. TO-DIR: for each X:
  • if X is UNNAMEDFILE: error, need a name, whole command fails
  • if X is NAMEDFILE: create/replace TO-DIR/name
  • if X is UNNAMEDDIR: copy source/* into TO/*, like with single-source
  • if X is NAMEDDIR: copy source/* into TO/name/*
Ok, updates: * sources are NAMEDDIR, UNNAMEDDIR, NAMEDFILE, UNNAMEDFILE * targets are DIR, FILE, or MISSING * single-source cases: * cp FILE TO-FILE: replace the contents * cp FILE TO-MISSING: create the target file * cp NAMEDFILE TO-DIR: create/replace TO-DIR/filename * cp UNNAMEDFILE TO-DIR: error: need a name * (cp -r FILE X: behave same as without -r) * cp DIR X: error: must use -r if any source is a directory * cp -r DIR TO-FILE: error, directories must be copied into other directories * cp -r NAMEDDIR TO-DIR: create TO-DIR/NAME/ and fill with contents * cp -r NAMEDDIR TO-MISSING: same: TO-MISSING/NAME/ filled with contents * cp -r UNNAMEDDIR TO-DIR: copy source/* into TO/* * cp -r UNNAMEDDIR TO-MISSING: same: mkdir TO-MISSING, fill with contents * multiple-source cases: * cp X.. TO-FILE: error: many-to-one requires target is a directory * cp NAMEDFILES.. TO-DIR: create/replace TO-DIR/filenames * cp NAMEDFILES.. TO-MISSING: mkdir, then treat like TO-DIR * cp SOMEUNNAMEDFILES.. X: error: need a name * (cp UNNAMEDFILE X with 1 source is ok, but not if there are multiple sources) * cp FILESDIRS.. X: error: must use -r if any source is a directory * cp -r X.. TO-MISSING: mkdir target, then treat as TO-DIR * cp -r X.. TO-DIR: for each X: * if X is UNNAMEDFILE: error, need a name, whole command fails * if X is NAMEDFILE: create/replace TO-DIR/name * if X is UNNAMEDDIR: copy source/* into TO/*, like with single-source * if X is NAMEDDIR: copy source/* into TO/name/*

(https://github.com/warner/tahoe-lafs/tree/2329) has a branch that adds the tests (and some useful refactoring). It does not yet make any behavior changes. Take a look at the new test_cli_cp.CopyOut and see if it covers all those cases.

(https://github.com/warner/tahoe-lafs/tree/2329) has a branch that adds the tests (and some useful refactoring). It does not yet make any behavior changes. Take a look at the new `test_cli_cp.CopyOut` and see if it covers all those cases.

Ok, the patch is ready for review: https://github.com/tahoe-lafs/tahoe-lafs/pull/143 . I rewrote the target-assignment code, cleaning up an awful lot in the process. I tried to make the diff as minimal as possible, but it may still look a bit ugly. The core 100-line cluster of functions was replaced by a different 100-line cluster of functions, but there's enough overlap that 'git diff' tries too hard to show you line-by-line changes, and does it badly. My best advice for reviewing it is to print out those 100 lines before, and those 100 lines after, and compare those two printouts, instead of looking at a detailed diff.

Ok, the patch is ready for review: <https://github.com/tahoe-lafs/tahoe-lafs/pull/143> . I rewrote the target-assignment code, cleaning up an awful lot in the process. I tried to make the diff as minimal as possible, but it may still look a bit ugly. The core 100-line cluster of functions was replaced by a different 100-line cluster of functions, but there's enough overlap that 'git diff' tries too hard to show you line-by-line changes, and does it badly. My best advice for reviewing it is to print out those 100 lines before, and those 100 lines after, and compare those two printouts, instead of looking at a detailed diff.

Two unexpected cases discovered during today's review:

1: cp FILE1 TARGETFILE/

2: cp -r DIR1 DIR2 TARGETDIR

We decided the first should signal an error: the trailing slash will only be accepted if the target is directory-like (either a pre-existing directory, or something missing that will be created as a directory, either because the source is a directory, or because there are multiple sources). If the target is directory-like, the trailing slash will not affect the copying behavior.

For the second, the realization was that this causes the contents of DIR1 and DIR2 to be merged together in the TARGETDIR, and thus the order of the source arguments matters (presumeably DIR2's contents will overwrite those of DIR1). The same thing happens if you copy multiple files of the same name into a directory (cp foo/file.txt bar/file.txt outdir).

We need to ensure the implementation preserves the order of the source arguments (I think my current patch does, but if I'd used a set instead of a dict, it would behave differently). We should also double-check that /bin/cp does the same thing.

Two unexpected cases discovered during today's review: ``` 1: cp FILE1 TARGETFILE/ 2: cp -r DIR1 DIR2 TARGETDIR ``` We decided the first should signal an error: the trailing slash will only be accepted if the target is directory-like (either a pre-existing directory, or something missing that will be created as a directory, either because the source is a directory, or because there are multiple sources). If the target is directory-like, the trailing slash will not affect the copying behavior. For the second, the realization was that this causes the contents of DIR1 and DIR2 to be merged together in the TARGETDIR, and thus the order of the source arguments matters (presumeably DIR2's contents will overwrite those of DIR1). The same thing happens if you copy multiple files of the same name into a directory (`cp foo/file.txt bar/file.txt outdir`). We need to ensure the implementation preserves the order of the source arguments (I think my current patch does, but if I'd used a set instead of a dict, it would behave differently). We should also double-check that `/bin/cp` does the same thing.

I guess there are a couple of different forms we should examine.

  • cp -r foo/dir bar/dir TARGETDIR
  • cp -r DIRCAP1 DIRCAP2 TARGETDIR

The first is using two named directories that both happen to have the same name. This will cause TARGETDIR/dir to be created, and the contents of the sources merged into it.

The second is using unnamed directories, triggering our "unnamed directories refer to the contents, not the bag itself" rule. Their contents will be merged into TARGETDIR.

/bin/cp doesn't have unnamed directories, so the only way to simulate the contents-not-bag rule is to use /bin/cp -r DIR1/* DIR2/* TARGETDIR, in which case any name collisions are obvious on the post-glob-expansion argv that's passed from the shell to cp. I think (but I'm not sure) that the only way to wind up with collisions in /bin/cp is if the basename of two SOURCE arguments are the same, since /bin/cp always uses the basename of the source to create a child of the target.

(in other words, /bin/cp may not actually give us precedent to follow)

I guess there are a couple of different forms we should examine. * `cp -r foo/dir bar/dir TARGETDIR` * `cp -r DIRCAP1 DIRCAP2 TARGETDIR` The first is using two named directories that both happen to have the same name. This will cause `TARGETDIR/dir` to be created, and the contents of the sources merged into it. The second is using *unnamed* directories, triggering our "unnamed directories refer to the contents, not the bag itself" rule. Their contents will be merged into TARGETDIR. `/bin/cp` doesn't have unnamed directories, so the only way to simulate the contents-not-bag rule is to use `/bin/cp -r DIR1/* DIR2/* TARGETDIR`, in which case any name collisions are obvious on the post-glob-expansion argv that's passed from the shell to `cp`. I think (but I'm not sure) that the only way to wind up with collisions in `/bin/cp` is if the basename of two SOURCE arguments are the same, since `/bin/cp` always uses the basename of the source to create a child of the target. (in other words, `/bin/cp` may not actually give us precedent to follow)

I think I was able to compress the rules above into the following set of assertions. These are the ones implemented by the code:

  • if any source is a directory, must use -r
  • if target is missing:
    • if source is a single file, target will be a file
    • else target will be a directory, so mkdir it
  • if there are multiple sources, target must be a dir
  • if target is a file, source must be a single file
  • if target is directory, sources must be named or a dir

Copying files into files is easy. Copying things into directories requires looking at the type of each source object:

  • target is a directory, so each source must be one of:
    • a named file (copied to a new file under the target)
    • a named directory (causes a new directory of the same name to be created under the target, then the contents of the source are copied into that directory)
    • an unnamed directory (the contents of the source are copied into the target, without a new directory being made)
  • If any source is an unnamed file, throw an error, since we have no way to name the output file.
I think I was able to compress the rules above into the following set of assertions. These are the ones implemented by the code: * if any source is a directory, must use -r * if target is missing: * if source is a single file, target will be a file * else target will be a directory, so mkdir it * if there are multiple sources, target must be a dir * if target is a file, source must be a single file * if target is directory, sources must be named or a dir Copying files into files is easy. Copying things into directories requires looking at the type of each source object: * target is a directory, so each source must be one of: * a named file (copied to a new file under the target) * a named directory (causes a new directory of the same name to be created under the target, then the contents of the source are copied into that directory) * an unnamed directory (the contents of the source are copied into the target, without a new directory being made) * If any source is an unnamed file, throw an error, since we have no way to name the output file.

New pull request is up: https://github.com/tahoe-lafs/tahoe-lafs/pull/144

This incorporates all the review feedback so far. It also rejects trailing slashes on file-like targets, ensures in-order copies of colliding sources (last source wins), fixes a bug I uncovered that preventing colliding sources from working anyways, and adds a bunch more test cases.

New pull request is up: <https://github.com/tahoe-lafs/tahoe-lafs/pull/144> This incorporates all the review feedback so far. It also rejects trailing slashes on file-like targets, ensures in-order copies of colliding sources (last source wins), fixes a bug I uncovered that preventing colliding sources from working anyways, and adds a bunch more test cases.

Reviewing.

Reviewing.
warner was unassigned by daira 2015-03-05 00:23:25 +00:00
daira self-assigned this 2015-03-05 00:23:25 +00:00

Ok, that PR (plus review feedback) has been landed, in e60392a. Remaining work: docs updates, and some notes for future cleanups.

Ok, that PR (plus review feedback) has been landed, in e60392a. Remaining work: docs updates, and some notes for future cleanups.
daira was unassigned by warner 2015-03-17 19:13:02 +00:00
warner self-assigned this 2015-03-17 19:13:02 +00:00

Some notes from our review discussion, which didn't suggest changes to the current behavior, but which should be recorded for future analysis:

  • cp SOURCE1 SOURCE2 missing is not so clear-cut. Current behavior is to mkdir, but maybe it should throw an error instead.
  • cp SOURCE1 SOURCE2 missing/ is obviously referring to a directory, so mkdir is more correct. (current behavior is to mkdir). (/bin/cp emits an error).
  • cp -r SOURCE1 SOURCEDIR2 missing is not clear-cut.

Cleanups to do:

  • add a test that uses a source directory which contains multiple files. the current tests use multiple source directories (with one file each)
  • find a way to reduce the with/without-trailing-slash redundancy in the test table
Some notes from our review discussion, which didn't suggest changes to the current behavior, but which should be recorded for future analysis: * `cp SOURCE1 SOURCE2 missing` is not so clear-cut. Current behavior is to mkdir, but maybe it should throw an error instead. * `cp SOURCE1 SOURCE2 missing/` is obviously referring to a directory, so mkdir is more correct. (current behavior is to mkdir). (`/bin/cp` emits an error). * `cp -r SOURCE1 SOURCEDIR2 missing` is not clear-cut. Cleanups to do: * add a test that uses a source directory which contains multiple files. the current tests use multiple source directories (with one file each) * find a way to reduce the with/without-trailing-slash redundancy in the test table
docs changes are in <https://github.com/tahoe-lafs/tahoe-lafs/pull/162>
Brian Warner <warner@lothar.com> commented 2015-05-04 04:50:31 +00:00
Owner

In /tahoe-lafs/trac/commit/97fd19407d610de298c45500f7e1ad3e62b8a263:

Improve docs on 'cp -r', noting the recent 2329 changes

refs ticket:2329
In [/tahoe-lafs/trac/commit/97fd19407d610de298c45500f7e1ad3e62b8a263](/tahoe-lafs/trac/commit/97fd19407d610de298c45500f7e1ad3e62b8a263): ``` Improve docs on 'cp -r', noting the recent 2329 changes refs ticket:2329 ```

ok, I think that's a wrap.

ok, I think that's a wrap.
warner added the
r/fixed
label 2015-05-04 05:06:06 +00:00
Brian Warner <warner@lothar.com> commented 2015-05-04 05:15:24 +00:00
Owner

In /tahoe-lafs/trac/commit/ca23c4fa23a77b1fa557c734a2ad1f2abe4e7688:

tahoe cp: ignore trailing slash on source arguments

This avoids an error case where an empty child name resulted in a
duplicate mkdir. It adds a precondition check to guard against empty
child names, and some test cases. It also cleans up a funny redundancy
noticed earlier (refs ticket:2329).
In [/tahoe-lafs/trac/commit/ca23c4fa23a77b1fa557c734a2ad1f2abe4e7688](/tahoe-lafs/trac/commit/ca23c4fa23a77b1fa557c734a2ad1f2abe4e7688): ``` tahoe cp: ignore trailing slash on source arguments This avoids an error case where an empty child name resulted in a duplicate mkdir. It adds a precondition check to guard against empty child names, and some test cases. It also cleans up a funny redundancy noticed earlier (refs ticket:2329). ```
Sign in to join this conversation.
No labels
c/code
c/code-dirnodes
c/code-encoding
c/code-frontend
c/code-frontend-cli
c/code-frontend-ftp-sftp
c/code-frontend-magic-folder
c/code-frontend-web
c/code-mutable
c/code-network
c/code-nodeadmin
c/code-peerselection
c/code-storage
c/contrib
c/dev-infrastructure
c/docs
c/operational
c/packaging
c/unknown
c/website
kw:2pc
kw:410
kw:9p
kw:ActivePerl
kw:AttributeError
kw:DataUnavailable
kw:DeadReferenceError
kw:DoS
kw:FileZilla
kw:GetLastError
kw:IFinishableConsumer
kw:K
kw:LeastAuthority
kw:Makefile
kw:RIStorageServer
kw:StringIO
kw:UncoordinatedWriteError
kw:about
kw:access
kw:access-control
kw:accessibility
kw:accounting
kw:accounting-crawler
kw:add-only
kw:aes
kw:aesthetics
kw:alias
kw:aliases
kw:aliens
kw:allmydata
kw:amazon
kw:ambient
kw:annotations
kw:anonymity
kw:anonymous
kw:anti-censorship
kw:api_auth_token
kw:appearance
kw:appname
kw:apport
kw:archive
kw:archlinux
kw:argparse
kw:arm
kw:assertion
kw:attachment
kw:auth
kw:authentication
kw:automation
kw:avahi
kw:availability
kw:aws
kw:azure
kw:backend
kw:backoff
kw:backup
kw:backupdb
kw:backward-compatibility
kw:bandwidth
kw:basedir
kw:bayes
kw:bbfreeze
kw:beta
kw:binaries
kw:binutils
kw:bitcoin
kw:bitrot
kw:blacklist
kw:blocker
kw:blocks-cloud-deployment
kw:blocks-cloud-merge
kw:blocks-magic-folder-merge
kw:blocks-merge
kw:blocks-raic
kw:blocks-release
kw:blog
kw:bom
kw:bonjour
kw:branch
kw:branding
kw:breadcrumbs
kw:brians-opinion-needed
kw:browser
kw:bsd
kw:build
kw:build-helpers
kw:buildbot
kw:builders
kw:buildslave
kw:buildslaves
kw:cache
kw:cap
kw:capleak
kw:captcha
kw:cast
kw:centos
kw:cffi
kw:chacha
kw:charset
kw:check
kw:checker
kw:chroot
kw:ci
kw:clean
kw:cleanup
kw:cli
kw:cloud
kw:cloud-backend
kw:cmdline
kw:code
kw:code-checks
kw:coding-standards
kw:coding-tools
kw:coding_tools
kw:collection
kw:compatibility
kw:completion
kw:compression
kw:confidentiality
kw:config
kw:configuration
kw:configuration.txt
kw:conflict
kw:connection
kw:connectivity
kw:consistency
kw:content
kw:control
kw:control.furl
kw:convergence
kw:coordination
kw:copyright
kw:corruption
kw:cors
kw:cost
kw:coverage
kw:coveralls
kw:coveralls.io
kw:cpu-watcher
kw:cpyext
kw:crash
kw:crawler
kw:crawlers
kw:create-container
kw:cruft
kw:crypto
kw:cryptography
kw:cryptography-lib
kw:cryptopp
kw:csp
kw:curl
kw:cutoff-date
kw:cycle
kw:cygwin
kw:d3
kw:daemon
kw:darcs
kw:darcsver
kw:database
kw:dataloss
kw:db
kw:dead-code
kw:deb
kw:debian
kw:debug
kw:deep-check
kw:defaults
kw:deferred
kw:delete
kw:deletion
kw:denial-of-service
kw:dependency
kw:deployment
kw:deprecation
kw:desert-island
kw:desert-island-build
kw:design
kw:design-review-needed
kw:detection
kw:dev-infrastructure
kw:devpay
kw:directory
kw:directory-page
kw:dirnode
kw:dirnodes
kw:disconnect
kw:discovery
kw:disk
kw:disk-backend
kw:distribute
kw:distutils
kw:dns
kw:do_http
kw:doc-needed
kw:docker
kw:docs
kw:docs-needed
kw:dokan
kw:dos
kw:download
kw:downloader
kw:dragonfly
kw:drop-upload
kw:duplicity
kw:dusty
kw:earth-dragon
kw:easy
kw:ec2
kw:ecdsa
kw:ed25519
kw:egg-needed
kw:eggs
kw:eliot
kw:email
kw:empty
kw:encoding
kw:endpoint
kw:enterprise
kw:enum34
kw:environment
kw:erasure
kw:erasure-coding
kw:error
kw:escaping
kw:etag
kw:etch
kw:evangelism
kw:eventual
kw:example
kw:excess-authority
kw:exec
kw:exocet
kw:expiration
kw:extensibility
kw:extension
kw:failure
kw:fedora
kw:ffp
kw:fhs
kw:figleaf
kw:file
kw:file-descriptor
kw:filename
kw:filesystem
kw:fileutil
kw:fips
kw:firewall
kw:first
kw:floatingpoint
kw:flog
kw:foolscap
kw:forward-compatibility
kw:forward-secrecy
kw:forwarding
kw:free
kw:freebsd
kw:frontend
kw:fsevents
kw:ftp
kw:ftpd
kw:full
kw:furl
kw:fuse
kw:garbage
kw:garbage-collection
kw:gateway
kw:gatherer
kw:gc
kw:gcc
kw:gentoo
kw:get
kw:git
kw:git-annex
kw:github
kw:glacier
kw:globalcaps
kw:glossary
kw:google-cloud-storage
kw:google-drive-backend
kw:gossip
kw:governance
kw:grid
kw:grid-manager
kw:gridid
kw:gridsync
kw:grsec
kw:gsoc
kw:gvfs
kw:hackfest
kw:hacktahoe
kw:hang
kw:hardlink
kw:heartbleed
kw:heisenbug
kw:help
kw:helper
kw:hint
kw:hooks
kw:how
kw:how-to
kw:howto
kw:hp
kw:hp-cloud
kw:html
kw:http
kw:https
kw:i18n
kw:i2p
kw:i2p-collab
kw:illustration
kw:image
kw:immutable
kw:impressions
kw:incentives
kw:incident
kw:init
kw:inlineCallbacks
kw:inotify
kw:install
kw:installer
kw:integration
kw:integration-test
kw:integrity
kw:interactive
kw:interface
kw:interfaces
kw:interoperability
kw:interstellar-exploration
kw:introducer
kw:introduction
kw:iphone
kw:ipkg
kw:iputil
kw:ipv6
kw:irc
kw:jail
kw:javascript
kw:joke
kw:jquery
kw:json
kw:jsui
kw:junk
kw:key-value-store
kw:kfreebsd
kw:known-issue
kw:konqueror
kw:kpreid
kw:kvm
kw:l10n
kw:lae
kw:large
kw:latency
kw:leak
kw:leasedb
kw:leases
kw:libgmp
kw:license
kw:licenss
kw:linecount
kw:link
kw:linux
kw:lit
kw:localhost
kw:location
kw:locking
kw:logging
kw:logo
kw:loopback
kw:lucid
kw:mac
kw:macintosh
kw:magic-folder
kw:manhole
kw:manifest
kw:manual-test-needed
kw:map
kw:mapupdate
kw:max_space
kw:mdmf
kw:memcheck
kw:memory
kw:memory-leak
kw:mesh
kw:metadata
kw:meter
kw:migration
kw:mime
kw:mingw
kw:minimal
kw:misc
kw:miscapture
kw:mlp
kw:mock
kw:more-info-needed
kw:mountain-lion
kw:move
kw:multi-users
kw:multiple
kw:multiuser-gateway
kw:munin
kw:music
kw:mutability
kw:mutable
kw:mystery
kw:names
kw:naming
kw:nas
kw:navigation
kw:needs-review
kw:needs-spawn
kw:netbsd
kw:network
kw:nevow
kw:new-user
kw:newcaps
kw:news
kw:news-done
kw:news-needed
kw:newsletter
kw:newurls
kw:nfc
kw:nginx
kw:nixos
kw:no-clobber
kw:node
kw:node-url
kw:notification
kw:notifyOnDisconnect
kw:nsa310
kw:nsa320
kw:nsa325
kw:numpy
kw:objects
kw:old
kw:openbsd
kw:openitp-packaging
kw:openssl
kw:openstack
kw:opensuse
kw:operation-helpers
kw:operational
kw:operations
kw:ophandle
kw:ophandles
kw:ops
kw:optimization
kw:optional
kw:options
kw:organization
kw:os
kw:os.abort
kw:ostrom
kw:osx
kw:osxfuse
kw:otf-magic-folder-objective1
kw:otf-magic-folder-objective2
kw:otf-magic-folder-objective3
kw:otf-magic-folder-objective4
kw:otf-magic-folder-objective5
kw:otf-magic-folder-objective6
kw:p2p
kw:packaging
kw:partial
kw:password
kw:path
kw:paths
kw:pause
kw:peer-selection
kw:performance
kw:permalink
kw:permissions
kw:persistence
kw:phone
kw:pickle
kw:pip
kw:pipermail
kw:pkg_resources
kw:placement
kw:planning
kw:policy
kw:port
kw:portability
kw:portal
kw:posthook
kw:pratchett
kw:preformance
kw:preservation
kw:privacy
kw:process
kw:profile
kw:profiling
kw:progress
kw:proxy
kw:publish
kw:pyOpenSSL
kw:pyasn1
kw:pycparser
kw:pycrypto
kw:pycrypto-lib
kw:pycryptopp
kw:pyfilesystem
kw:pyflakes
kw:pylint
kw:pypi
kw:pypy
kw:pysqlite
kw:python
kw:python3
kw:pythonpath
kw:pyutil
kw:pywin32
kw:quickstart
kw:quiet
kw:quotas
kw:quoting
kw:raic
kw:rainhill
kw:random
kw:random-access
kw:range
kw:raspberry-pi
kw:reactor
kw:readonly
kw:rebalancing
kw:recovery
kw:recursive
kw:redhat
kw:redirect
kw:redressing
kw:refactor
kw:referer
kw:referrer
kw:regression
kw:rekey
kw:relay
kw:release
kw:release-blocker
kw:reliability
kw:relnotes
kw:remote
kw:removable
kw:removable-disk
kw:rename
kw:renew
kw:repair
kw:replace
kw:report
kw:repository
kw:research
kw:reserved_space
kw:response-needed
kw:response-time
kw:restore
kw:retrieve
kw:retry
kw:review
kw:review-needed
kw:reviewed
kw:revocation
kw:roadmap
kw:rollback
kw:rpm
kw:rsa
kw:rss
kw:rst
kw:rsync
kw:rusty
kw:s3
kw:s3-backend
kw:s3-frontend
kw:s4
kw:same-origin
kw:sandbox
kw:scalability
kw:scaling
kw:scheduling
kw:schema
kw:scheme
kw:scp
kw:scripts
kw:sdist
kw:sdmf
kw:security
kw:self-contained
kw:server
kw:servermap
kw:servers-of-happiness
kw:service
kw:setup
kw:setup.py
kw:setup_requires
kw:setuptools
kw:setuptools_darcs
kw:sftp
kw:shared
kw:shareset
kw:shell
kw:signals
kw:simultaneous
kw:six
kw:size
kw:slackware
kw:slashes
kw:smb
kw:sneakernet
kw:snowleopard
kw:socket
kw:solaris
kw:space
kw:space-efficiency
kw:spam
kw:spec
kw:speed
kw:sqlite
kw:ssh
kw:ssh-keygen
kw:sshfs
kw:ssl
kw:stability
kw:standards
kw:start
kw:startup
kw:static
kw:static-analysis
kw:statistics
kw:stats
kw:stats_gatherer
kw:status
kw:stdeb
kw:storage
kw:streaming
kw:strports
kw:style
kw:stylesheet
kw:subprocess
kw:sumo
kw:survey
kw:svg
kw:symlink
kw:synchronous
kw:tac
kw:tahoe-*
kw:tahoe-add-alias
kw:tahoe-admin
kw:tahoe-archive
kw:tahoe-backup
kw:tahoe-check
kw:tahoe-cp
kw:tahoe-create-alias
kw:tahoe-create-introducer
kw:tahoe-debug
kw:tahoe-deep-check
kw:tahoe-deepcheck
kw:tahoe-lafs-trac-stream
kw:tahoe-list-aliases
kw:tahoe-ls
kw:tahoe-magic-folder
kw:tahoe-manifest
kw:tahoe-mkdir
kw:tahoe-mount
kw:tahoe-mv
kw:tahoe-put
kw:tahoe-restart
kw:tahoe-rm
kw:tahoe-run
kw:tahoe-start
kw:tahoe-stats
kw:tahoe-unlink
kw:tahoe-webopen
kw:tahoe.css
kw:tahoe_files
kw:tahoewapi
kw:tarball
kw:tarballs
kw:tempfile
kw:templates
kw:terminology
kw:test
kw:test-and-set
kw:test-from-egg
kw:test-needed
kw:testgrid
kw:testing
kw:tests
kw:throttling
kw:ticket999-s3-backend
kw:tiddly
kw:time
kw:timeout
kw:timing
kw:to
kw:to-be-closed-on-2011-08-01
kw:tor
kw:tor-protocol
kw:torsocks
kw:tox
kw:trac
kw:transparency
kw:travis
kw:travis-ci
kw:trial
kw:trickle
kw:trivial
kw:truckee
kw:tub
kw:tub.location
kw:twine
kw:twistd
kw:twistd.log
kw:twisted
kw:twisted-14
kw:twisted-trial
kw:twitter
kw:twn
kw:txaws
kw:type
kw:typeerror
kw:ubuntu
kw:ucwe
kw:ueb
kw:ui
kw:unclean
kw:uncoordinated-writes
kw:undeletable
kw:unfinished-business
kw:unhandled-error
kw:unhappy
kw:unicode
kw:unit
kw:unix
kw:unlink
kw:update
kw:upgrade
kw:upload
kw:upload-helper
kw:uri
kw:url
kw:usability
kw:use-case
kw:utf-8
kw:util
kw:uwsgi
kw:ux
kw:validation
kw:variables
kw:vdrive
kw:verify
kw:verlib
kw:version
kw:versioning
kw:versions
kw:video
kw:virtualbox
kw:virtualenv
kw:vista
kw:visualization
kw:visualizer
kw:vm
kw:volunteergrid2
kw:volunteers
kw:vpn
kw:wapi
kw:warners-opinion-needed
kw:warning
kw:weapi
kw:web
kw:web.port
kw:webapi
kw:webdav
kw:webdrive
kw:webport
kw:websec
kw:website
kw:websocket
kw:welcome
kw:welcome-page
kw:welcomepage
kw:wiki
kw:win32
kw:win64
kw:windows
kw:windows-related
kw:winscp
kw:workaround
kw:world-domination
kw:wrapper
kw:write-enabler
kw:wui
kw:x86
kw:x86-64
kw:xhtml
kw:xml
kw:xss
kw:zbase32
kw:zetuptoolz
kw:zfec
kw:zookos-opinion-needed
kw:zope
kw:zope.interface
p/blocker
p/critical
p/major
p/minor
p/normal
p/supercritical
p/trivial
r/cannot reproduce
r/duplicate
r/fixed
r/invalid
r/somebody else's problem
r/was already fixed
r/wontfix
r/worksforme
t/defect
t/enhancement
t/task
v/0.2.0
v/0.3.0
v/0.4.0
v/0.5.0
v/0.5.1
v/0.6.0
v/0.6.1
v/0.7.0
v/0.8.0
v/0.9.0
v/1.0.0
v/1.1.0
v/1.10.0
v/1.10.1
v/1.10.2
v/1.10a2
v/1.11.0
v/1.12.0
v/1.12.1
v/1.13.0
v/1.14.0
v/1.15.0
v/1.15.1
v/1.2.0
v/1.3.0
v/1.4.1
v/1.5.0
v/1.6.0
v/1.6.1
v/1.7.0
v/1.7.1
v/1.7β
v/1.8.0
v/1.8.1
v/1.8.2
v/1.8.3
v/1.8β
v/1.9.0
v/1.9.0-s3branch
v/1.9.0a1
v/1.9.0a2
v/1.9.0b1
v/1.9.1
v/1.9.2
v/1.9.2a1
v/cloud-branch
v/unknown
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac#2329
No description provided.