Changes between Initial Version and Version 1 of Ticket #2390


Ignore:
Timestamp:
2015-03-18T00:45:23Z (10 years ago)
Author:
daira
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2390

    • Property Status changed from new to assigned
  • Ticket #2390 – Description

    initial v1  
    11{{{
     2[ERROR]
     3Traceback (most recent call last):
     4  File "c:\tahoe\git\tahoe-magic\src\allmydata\frontends\drop_upload.py", line 93, in _add_file
     5    u = FileName(path.path, self._convergence)
     6  File "c:\tahoe\git\tahoe-magic\src\allmydata\immutable\upload.py", line 1482, in __init__
     7    FileHandle.__init__(self, open(filename, "rb"), convergence=convergence)
     8exceptions.IOError: [Errno 13] Permission denied: u'\\\\?\\C:\\tahoe\\git\\tahoe-magic\\_trial_temp-
     91\\drop_upload.RealTest.test_drop_upload\\loc\u0101l_dir\\directory'
     10
     11allmydata.test.test_drop_upload.RealTest.test_drop_upload
    212}}}
     13
     14This failure happens only if [https://github.com/tahoe-lafs/tahoe-lafs/blob/3fb9fa967ad59ff520a8e5fe2b4ee8a667b49219/src/allmydata/test/test_drop_upload.py#L57 this code] is included in `DropUploadTestMixin._test`:
     15
     16{{{
     17    # Test that we tolerate creation of a subdirectory.
     18    d.addCallback(lambda ign: os.mkdir(os.path.join(self.local_dir, u"directory")))
     19}}}
     20
     21The problem is that on Windows, `DropUploader._process` is called for changes to directories as well as files (because `ReadDirectoryChangesW` makes no distinction between them). So, in [https://github.com/tahoe-lafs/tahoe-lafs/blob/3fb9fa967ad59ff520a8e5fe2b4ee8a667b49219/src/allmydata/frontends/drop_upload.py#L93 this code]:
     22{{{
     23    u = FileName(path.path, self._convergence)
     24    return self._parent.add_file(name, u)
     25}}}
     26`path.path` will be the path of a directory, which causes a permission error when it is opened for reading as though it were a file.