#2390 closed defect (fixed)

drop-upload on Windows: can't tolerate creation of a directory under the watched directory

Reported by: daira Owned by: daira
Priority: major Milestone: 1.12.0
Component: code-frontend-magic-folder Version: 1.10.0
Keywords: drop-upload otf-magic-folder-objective4 windows error Cc:
Launchpad Bug:

Description (last modified by daira)

[ERROR]
Traceback (most recent call last):
  File "c:\tahoe\git\tahoe-magic\src\allmydata\frontends\drop_upload.py", line 93, in _add_file
    u = FileName(path.path, self._convergence)
  File "c:\tahoe\git\tahoe-magic\src\allmydata\immutable\upload.py", line 1482, in __init__
    FileHandle.__init__(self, open(filename, "rb"), convergence=convergence)
exceptions.IOError: [Errno 13] Permission denied: u'\\\\?\\C:\\tahoe\\git\\tahoe-magic\\_trial_temp-
1\\drop_upload.RealTest.test_drop_upload\\loc\u0101l_dir\\directory'

allmydata.test.test_drop_upload.RealTest.test_drop_upload

This failure happens only if this code is included in DropUploadTestMixin._test:

    # Test that we tolerate creation of a subdirectory.
    d.addCallback(lambda ign: os.mkdir(os.path.join(self.local_dir, u"directory")))

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 this code:

    u = FileName(path.path, self._convergence)
    return self._parent.add_file(name, u)

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.

Change History (5)

comment:1 Changed at 2015-03-18T00:45:23Z by daira

  • Description modified (diff)
  • Status changed from new to assigned

comment:2 Changed at 2015-04-02T14:56:09Z by daira

  • Keywords otf-magic-folder-objective2 added; otf-magic-folder removed

comment:3 Changed at 2015-06-01T16:11:09Z by daira

  • Keywords magic-folder added

Add magic-folder keyword to all drop-upload tickets.

comment:4 Changed at 2015-10-16T19:05:59Z by daira

  • Keywords otf-magic-folder-objective4 added; otf-magic-folder-objective2 magic-folder removed
  • Resolution set to fixed
  • Status changed from assigned to closed

This ticket is obsolete because the main (not Windows-specific) uploader/downloader code now expects events for directories.

comment:5 Changed at 2016-03-22T05:02:52Z by warner

  • Milestone changed from 1.11.0 to 1.12.0

Milestone renamed

Note: See TracTickets for help on using tickets.