← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 666482] [NEW] [trunk] outlook and openerp-outlook-plugin.zip

 

Public bug reported:

The outlook addon reads a file named "openerp-outlook-plugin.zip" from
"addons_path" configuration setting. But this setting can have multiple
paths, separated by a comma. In this case, the function "default_get"
crashes the server.


/addons/outlook/installer.py

Line 36:

-        file = open(config['addons_path'] + "/outlook/plugin/openerp-outlook-plugin.zip", 'r')
-        data['plugin_file'] = base64.encodestring(file.read())
+        paths = config['addons_path'].split(',')
+        for path in paths:
+            filename = path + "/outlook/plugin/openerp-outlook-plugin.zip"
+            if os.path.isfile(filename):
+                data['plugin_file'] = base64.encodestring(open(filename, 'r').read())

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
[trunk] outlook and openerp-outlook-plugin.zip
https://bugs.launchpad.net/bugs/666482
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Addons Modules: New

Bug description:
The outlook addon reads a file named "openerp-outlook-plugin.zip" from "addons_path" configuration setting. But this setting can have multiple paths, separated by a comma. In this case, the function "default_get" crashes the server.


/addons/outlook/installer.py

Line 36:

-        file = open(config['addons_path'] + "/outlook/plugin/openerp-outlook-plugin.zip", 'r')
-        data['plugin_file'] = base64.encodestring(file.read())
+        paths = config['addons_path'].split(',')
+        for path in paths:
+            filename = path + "/outlook/plugin/openerp-outlook-plugin.zip"
+            if os.path.isfile(filename):
+                data['plugin_file'] = base64.encodestring(open(filename, 'r').read())





Follow ups

References