reassign 487220 opensync-module-python
found 487220 0.22-1
severity 487220 normal
tags 487220 + patch
kthxbye

On Sun, Jun 22, 2008 at 12:37:25AM +0100, Don Alexander wrote:
> Well i tried that.. re-installing it but still retain the Runtime
> error.

It turns out the opensync python module loads every file in the plugin
directory. Therefore, the actual .py plugin was loading absolutely fine;
it was the .pyc file spewing out the RuntimeError. It depends on the
python version opensync-module-python was compiled with which is probably
another bug with the python module packaging (the module should be
compiled for every version in "pyversions -s") but I'll ignore that
here.

Therefore this is a problem in opensync-module-python. I have set the
severity to normal and not wishlist because .pyc files will have the
same name as their .pyc counterpart, therefore causing name collision
etc.

This has been fixed upstream in the 0.30 branch[0]. I have taken the fix
from there and made a patch for the 0.22 version that I think should be
used until 0.30 hits Debian.

Thanks,

0. http://opensync.org/changeset/1753#file2 (what a horribly long diff)

-- 
Jonny Lamb, UK                                   [EMAIL PROTECTED]
http://jonnylamb.com                                     GPG: 0x2E039402
diff -Nruad -Nruad libopensync-plugin-python-0.22.orig/src/python_module.c 
libopensync-plugin-python-0.22/src/python_module.c
--- libopensync-plugin-python-0.22.orig/src/python_module.c     2007-03-27 
12:49:52.000000000 +0100
+++ libopensync-plugin-python-0.22/src/python_module.c  2008-06-22 
02:06:01.000000000 +0100
@@ -386,8 +386,10 @@
        while ((de = g_dir_read_name(dir))) {
                char *filename = g_build_filename(path, de, NULL);
                OSyncError *error = NULL;
-               if (!register_plugin(env, osync_module, filename, &error))
-                       osync_debug("python", 1, "Couldn't register plugin 
\"%s\": %s", filename, osync_error_print(&error));
+               if (g_str_has_suffix(filename, ".py")) {
+                       if (!register_plugin(env, osync_module, filename, 
&error))
+                               osync_debug("python", 1, "Couldn't register 
plugin \"%s\": %s", filename, osync_error_print(&error));
+               }
 
                g_free(filename);
        }

Attachment: signature.asc
Description: Digital signature

Reply via email to