| 2 | [ERROR] |
| 3 | Traceback (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) |
| 8 | exceptions.IOError: [Errno 13] Permission denied: u'\\\\?\\C:\\tahoe\\git\\tahoe-magic\\_trial_temp- |
| 9 | 1\\drop_upload.RealTest.test_drop_upload\\loc\u0101l_dir\\directory' |
| 10 | |
| 11 | allmydata.test.test_drop_upload.RealTest.test_drop_upload |
| 13 | |
| 14 | This 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 | |
| 21 | The 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. |