Refreshing Python filters?

Julien ÉLIE julien at trigofacile.com
Sun Jun 8 09:36:27 UTC 2008


Hi,

[David, maybe you suffer from this problem with your script.]


I have just tried to play with filter_innd.py but I have an issue with
applying the changes done in this file when reloading it.

Is there a special thing to do in order to correctly reload a Python filter?

In fact, I cannot reload it without *stopping* and *restarting* INN!
I reckon it is a bug...


# Start the news server at 11:15 (new .pyc file generated).

11:17 news at news ~/bin/filter% ll filter_innd.py*
-rw-r--r-- 1 news news 8,8K 2008-06-08 11:07 filter_innd.py
-rw-rw-r-- 1 news news 7,3K 2008-06-08 11:17 filter_innd.pyc
-rw-r--r-- 1 news news 8,7K 2007-04-22 11:03 filter_innd.py.OLD

# I reload the Python filter to test.  Everything is OK.

11:17 news at news ~/bin/filter% ctlinnd reload filter.python ''
Ok

# Let's modify the Python filter for it to fail.

11:18 news at news ~/bin/filter% vi filter_innd.py
11:18 news at news ~/bin/filter% ctlinnd reload filter.python ''
ctlinnd: Failed to reload filter_innd.py
zsh: exit 1     ctlinnd reload filter.python ''

# All right.  Python filtering is not disabled.
# Let's revert the changes so that the Python filter is right.

11:18 news at news ~/bin/filter% vi filter_innd.py
11:18 news at news ~/bin/filter% ctlinnd reload filter.python ''
ctlinnd: Failed to reload filter_innd.py
zsh: exit 1     ctlinnd reload filter.python ''

# ??

11:18 news at news ~/bin/filter% ctlinnd python y
Ok
11:18 news at news ~/bin/filter% ctlinnd mode
Server running
-----> Python filtering enabled

# Let's try again.

11:18 news at news ~/bin/filter% ctlinnd reload filter.python ''
ctlinnd: Failed to reload filter_innd.py
zsh: exit 1     ctlinnd reload filter.python ''
11:18 news at news ~/bin/filter% ctlinnd xexec all
11:19 news at news ~/bin/filter% ctlinnd reload filter.python ''
ctlinnd: Failed to reload filter_innd.py
zsh: exit 1     ctlinnd reload filter.python ''

# Even a 'ctlinnd xexec all' does not reload it!
# Yet, a new .pyc file was generated.  But they are now always
# regenerated -- I do not know when they are...

11:19 news at news ~/bin/filter% ll filter_innd.py*
-rw-r--r-- 1 news news 8,8K 2008-06-08 11:18 filter_innd.py
-rw-rw-r-- 1 news news 7,3K 2008-06-08 11:18 filter_innd.pyc
-rw-r--r-- 1 news news 8,7K 2007-04-22 11:03 filter_innd.py.OLD

# Only stopping and restarting the news server works...


Note that there is no problem of reload if I change things in the Python filter
and if these changes are correct.
Note that the above behaviour (reloading issues after a bad filter_innd.py)
does not happen to filter_innd.pl (it reloads well when the script is fixed).

-- 
Julien ÉLIE

« Le carré est une figure qui a un angle droit dans chaque coin. » (Jean-Charles) 



More information about the inn-workers mailing list