Modify

Ticket #38 (closed defect: fixed)

Opened 6 months ago

Last modified 6 months ago

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

pyinotify.diff Download (1.3 KB) - added by facundo@… 6 months ago.
Patch that fixes the overlapping problem

Change History

Changed 6 months ago by facundo@…

Patch that fixes the overlapping problem

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.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.