The _path_is_dir function in file system notifications on windows is broken

Bug #867567 reported by Manuel de la Peña
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Fix Released
High
Manuel de la Peña

Bug Description

The function _path_is_dir does not work as expected, the following implementation is wrong:

    @is_valid_windows_path(path_indexes=[1])
    def _path_is_dir(self, path):
        """Check if the path is a dir and update the local subdir list."""
        self.log.debug('Testing if path %r is a dir', path)
        is_dir = False
        if os.path.exists(path):
            is_dir = os.path.isdir(path)
        else:
            self.log.debug('Path "%s" was deleted subdirs are %s.',
                path, self._subdirs)
            # we removed the path, we look in the internal list
            if path in self._subdirs:
                is_dir = True
                self._subdirs.remove(path)
        if is_dir:
            self.log.debug('Adding %s to subdirs %s', path, self._subdirs)
            self._subdirs.append(path)
        return is_dir

This can brake terribly.

Tags: u1-windows

Related branches

Changed in ubuntuone-client:
status: New → Fix Committed
Changed in ubuntuone-client:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.