diff --git a/CHANGELOG b/CHANGELOG index aa33778aea..2ba2e86a26 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Add timeout to Report.convert * Allow records from XML with noupdate to be deleted * Add ir.calendar for month and day * Rename languages: hu_HU, it_IT and pt_BR into hu, it and pt diff --git a/trytond/report/report.py b/trytond/report/report.py index e1cc6ce5e4..11504a6950 100644 --- a/trytond/report/report.py +++ b/trytond/report/report.py @@ -296,7 +296,7 @@ class Report(URLMixin, PoolBase): return data @classmethod - def convert(cls, report, data): + def convert(cls, report, data, timeout=5 * 60): "converts the report data to another mimetype if necessary" input_format = report.template_extension output_format = report.extension or report.template_extension @@ -315,7 +315,7 @@ class Report(URLMixin, PoolBase): '--headless', '--nolockcheck', '--nodefault', '--norestore', '--convert-to', oext, '--outdir', dtemp, path] output = os.path.splitext(path)[0] + os.extsep + oext - subprocess.check_call(cmd) + subprocess.check_call(cmd, timeout=timeout) if os.path.exists(output): with open(output, 'rb') as fp: return oext, fp.read()