← Back to team overview

openerp-india team mailing list archive

[Bug 1110353] [NEW] report_webkit should test supplied wkhtmltopdf path

 

Public bug reported:

The WebKitParser get_lib method retrieves the 'webkit_path' from
ir.config_parameter. If a value is supplied, it assumes that the path is
usable and just returns it. Instead, it should check that the path
actually exists and is executable.

In the case that this path either doesn't exist or is not executable,
the error will not get caught until, in the generate_pdf method, the
subprocess.call function throws an exception. This exception gets caught
but is not reported; the method just deletes the temporary file(s) and
then proceeds to attempt to read the generated PDF. It's only here that
an error will get reported (file not found) and that error is not
indicative of the actual problem.

The attached patch does the check on the supplied path. It also includes
a more appropriate error message.

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

** Patch added: "webkit_report.py.patch"
   https://bugs.launchpad.net/bugs/1110353/+attachment/3507428/+files/webkit_report.py.patch

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1110353

Title:
  report_webkit should test supplied wkhtmltopdf path

Status in OpenERP Addons (modules):
  New

Bug description:
  The WebKitParser get_lib method retrieves the 'webkit_path' from
  ir.config_parameter. If a value is supplied, it assumes that the path
  is usable and just returns it. Instead, it should check that the path
  actually exists and is executable.

  In the case that this path either doesn't exist or is not executable,
  the error will not get caught until, in the generate_pdf method, the
  subprocess.call function throws an exception. This exception gets
  caught but is not reported; the method just deletes the temporary
  file(s) and then proceeds to attempt to read the generated PDF. It's
  only here that an error will get reported (file not found) and that
  error is not indicative of the actual problem.

  The attached patch does the check on the supplied path. It also
  includes a more appropriate error message.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1110353/+subscriptions


Follow ups

References