cp -r tries to mkdir the directory more than once #2399

Closed
opened 2015-04-06 03:37:23 +00:00 by ambimorph · 2 comments
ambimorph commented 2015-04-06 03:37:23 +00:00
Owner

Target directory tmp did not exist before running the following:

$ tahoe cp -r lae:admin/Latest/ tmp
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/runner.py", line 156, in run
    rc = runner(sys.argv[1:], install_node_control=install_node_control)
  File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/runner.py", line 141, in runner
    rc = cli.dispatch[command](so)
  File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/cli.py", line 541, in cp
    rc = tahoe_cp.copy(options)
  File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/tahoe_cp.py", line 831, in copy
    return Copier().do_copy(options)
  File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/tahoe_cp.py", line 479, in do_copy
    status = self.try_copy()
  File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/tahoe_cp.py", line 565, in try_copy
    return self.copy_things_to_directory(sources, target)
  File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/tahoe_cp.py", line 719, in copy_things_to_directory
    targetmap = self.build_targetmap(sources, target)
  File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/tahoe_cp.py", line 762, in build_targetmap
    new_target = target.get_child_target(name)
  File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/tahoe_cp.py", line 159, in get_child_target
    os.makedirs(pathname)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: '/home/amber/tmp/'
Target directory tmp did not exist before running the following: ``` $ tahoe cp -r lae:admin/Latest/ tmp Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/runner.py", line 156, in run rc = runner(sys.argv[1:], install_node_control=install_node_control) File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/runner.py", line 141, in runner rc = cli.dispatch[command](so) File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/cli.py", line 541, in cp rc = tahoe_cp.copy(options) File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/tahoe_cp.py", line 831, in copy return Copier().do_copy(options) File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/tahoe_cp.py", line 479, in do_copy status = self.try_copy() File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/tahoe_cp.py", line 565, in try_copy return self.copy_things_to_directory(sources, target) File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/tahoe_cp.py", line 719, in copy_things_to_directory targetmap = self.build_targetmap(sources, target) File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/tahoe_cp.py", line 762, in build_targetmap new_target = target.get_child_target(name) File "/usr/local/lib/python2.7/dist-packages/allmydata/scripts/tahoe_cp.py", line 159, in get_child_target os.makedirs(pathname) File "/usr/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 17] File exists: '/home/amber/tmp/' ```
tahoe-lafs added the
code-frontend-cli
normal
defect
1.10.0
labels 2015-04-06 03:37:23 +00:00
tahoe-lafs added this to the undecided milestone 2015-04-06 03:37:23 +00:00

I looked over Amber's shoulder and asked her to change that os.makedirs() in tahoe_cp.py line 159 to fileutil.make_dirs(), and she did, and then the command worked and she was able to restore her files.

I looked over Amber's shoulder and asked her to change that `os.makedirs()` in tahoe_cp.py line 159 to `fileutil.make_dirs()`, and she did, and then the command worked and she was able to restore her files.
warner modified the milestone from undecided to 1.10.1 2015-04-07 05:30:01 +00:00
warner self-assigned this 2015-04-07 05:30:01 +00:00
Brian Warner <warner@lothar.com> commented 2015-05-04 05:15:26 +00:00
Author
Owner

In /tahoe-lafs/trac-2024-07-25/commit/b32664b4519facbe4b7208eb282e7d723727eb11:

Merge branch '2399-cp-mkdir'

closes ticket:2399
In [/tahoe-lafs/trac-2024-07-25/commit/b32664b4519facbe4b7208eb282e7d723727eb11](/tahoe-lafs/trac-2024-07-25/commit/b32664b4519facbe4b7208eb282e7d723727eb11): ``` Merge branch '2399-cp-mkdir' closes ticket:2399 ```
tahoe-lafs added the
fixed
label 2015-05-04 05:15:26 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#2399
No description provided.