Ticket #38 (closed defect: fixed)
MOVE_SELF handling renames the directory incorrectly
| Reported by: | facundo@… | Owned by: | |
|---|---|---|---|
| Priority: | major | Keywords: | |
| Cc: | Launchpad Bug: | Bug 530268 |
Description
I have a path fully watched. Rename one directory from "test_dir", to "test_dir_renamed" (note that they "overlap").
So, it gets into process_IN_MOVE_SELF(), and tries to fix the paths that it has in the watch managers.
In the loop where it checks which paths to choose, it gets: "tests/home_dir/root/test_dir_renamed".
The src_path is:
tests/home_dir/root/test_dir
The dest_path is:
tests/home_dir/root/test_dir_renamed
And the code *incorrectly* renames it to:
tests/home_dir/root/test_dir_renamed/renamed
One way to avoid this overlapping issue is to add the "/" to the source_path, so you don't get in the trap of comparing with .startswith().
A patch is attached here that fixes the problem in the described way.
Attachments
Change History
Changed 6 months ago by facundo@…
-
attachment
pyinotify.diff
added
comment:1 Changed 6 months ago by seb
- Status changed from new to closed
- Resolution set to fixed
Hi Facundo,
I think your trick is the right way to fix this bug indeed, please pull this commit.
Thanks for your patch.

Patch that fixes the overlapping problem