Re: Strange behaviour with pyinotify



Hi Jason,

I followed your steps and it worked fine to the end. I'm using Nautilus 2.30.1 and pyinotify 0.9.0. Maybe the problem is with pyinotify you're using.

Here is my console log if it may help you:

$ python watch_test2.py
Temp dir: /tmp/pyin-sUL3z_
Interrupt (Ctrl-C) to exit
Handled: IN_CREATE|IN_ISDIR for /tmp/pyin-sUL3z_/untitled folder
Handled: IN_MOVED_FROM|IN_ISDIR for /tmp/pyin-sUL3z_/untitled folder
Handled: IN_MOVED_TO|IN_ISDIR for /tmp/pyin-sUL3z_/test
Handled: IN_MOVE_SELF for /tmp/pyin-sUL3z_/test
Handled: IN_MOVED_FROM|IN_ISDIR for /tmp/pyin-sUL3z_/test
Handled: IN_MOVED_TO|IN_ISDIR for /tmp/pyin-sUL3z_/test-2
Handled: IN_MOVE_SELF for /tmp/pyin-sUL3z_/test-2
Handled: IN_MOVED_FROM|IN_ISDIR for /tmp/pyin-sUL3z_/test-2
Handled: IN_MOVED_TO|IN_ISDIR for /tmp/pyin-sUL3z_/test
Handled: IN_MOVE_SELF for /tmp/pyin-sUL3z_/test
^CInterrupted, stopping notifications

Bests,
Ahmad Sherif

On Mon, Sep 13, 2010 at 9:41 AM, Jason Heeris <jason heeris gmail com> wrote:
I've come across some strange behaviour appearing with pyinotify when
renaming directories in Nautilus. I'm not sure why this doesn't work
as expected, or whether it's Nautilus or pyinotify or my own
misunderstanding, so I'm asking here first :)

Steps:
1. Run the attached script in a console. It will create some directory
in /tmp with the prefix "pyin-"
2. Open this new directory in Nautilus
3. Hit Ctrl+Shift+N to create a new "untitled folder"
4. Call it "test"
5. Select the folder "test", and hit F2 to rename it
6. Rename it "test-2" (and hit enter)
7. Hit F2 again, rename it back to "test"
8. Go back to the console and hit Ctrl+C (the temp dir will be removed)

After step #6, the python script will show:

Handled: IN_MOVE_SELF for /tmp/pyin-0kv7xu/test-2/2

...which I find strange, since there's no test-2/2 directory. You get
further errors when you try to rename (or delete) "test-2" in step #7.
The whole transcript is below.

Initially I thought this was a pyinotify problem, but I can't pin it
down using console commands or pure python, so it got me thinking that
it was a Nautilus related issue. Does anyone know what's happening?

(Please CC me on replies.)

Cheers,
Jason

---- transcript of pyinotify session ----

$ python watch_test2.py
Temp dir: /tmp/pyin-0kv7xu
Interrupt (Ctrl-C) to exit
Handled: IN_CREATE|IN_ISDIR for /tmp/pyin-0kv7xu/untitled folder
Handled: IN_MOVED_FROM|IN_ISDIR for /tmp/pyin-0kv7xu/untitled folder
Handled: IN_MOVED_TO|IN_ISDIR for /tmp/pyin-0kv7xu/test
Handled: IN_MOVE_SELF for /tmp/pyin-0kv7xu/test
Handled: IN_MOVED_FROM|IN_ISDIR for /tmp/pyin-0kv7xu/test
Handled: IN_MOVED_TO|IN_ISDIR for /tmp/pyin-0kv7xu/test-2
Handled: IN_MOVE_SELF for /tmp/pyin-0kv7xu/test-2/2
Handled: IN_MOVED_FROM|IN_ISDIR for /tmp/pyin-0kv7xu/test-2
Handled: IN_MOVED_TO|IN_ISDIR for /tmp/pyin-0kv7xu/test
[Pyinotify ERROR] The pathname '/tmp/pyin-0kv7xu/test-2/2' of this
watch <Watch wd=2 mask=4034 auto_add=True proc_fun=None
path=/tmp/pyin-0kv7xu/test-2/2 exclude_filter=<function <lambda> at
0x1182758> dir=True > has probably changed and couldn't be updated, so
it cannot be trusted anymore. To fix this error move directories/files
only between watched parents directories, in this case e.g. put a
watch on '/tmp/pyin-0kv7xu/test-2'.
Handled: IN_MOVE_SELF for /tmp/pyin-0kv7xu/test-2/2-unknown-path
^CInterrupted, stopping notifications

--
nautilus-list mailing list
nautilus-list gnome org
http://mail.gnome.org/mailman/listinfo/nautilus-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]