[7.0] test hr_holidays/test/hr_holidays_report.yml fails when run in August

Bug #1207810 reported by Dieter
24
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
OpenERP Publisher's Warranty Team

Bug Description

When this YAML tets in run in august, it fails:

UnicodeDecodeError('ascii', '<date month="ao\xfbt" year="2013" />', 15, 16, 'ordinal not in range(128)')
Stacktrace

Traceback (most recent call last):
  File "C:\Jenkins\vlabus_test\openerp\addons-external\vlabus_smile_test\smile_test.py", line 166, in test
    self._run_test(new_cr, module_name, filename)
  File "C:\Jenkins\vlabus_test\openerp\addons-external\vlabus_smile_test\smile_test.py", line 74, in _run_test
    tools.convert_yaml_import(cr, module_name, open_file, kind='test', idref=None, mode='update', noupdate=False)
  File "C:\Jenkins\vlabus_test\openerp\openerp-server\openerp\tools\yaml_import.py", line 928, in yaml_import
    yaml_interpreter.process(yaml_string)
  File "C:\Jenkins\vlabus_test\openerp\openerp-server\openerp\tools\yaml_import.py", line 864, in process
    self._process_node(node)
  File "C:\Jenkins\vlabus_test\openerp\openerp-server\openerp\tools\yaml_import.py", line 877, in _process_node
    self.process_python(node)
  File "C:\Jenkins\vlabus_test\openerp\openerp-server\openerp\tools\yaml_import.py", line 550, in process_python
    unsafe_eval(code_obj, {'ref': self.get_id}, code_context)
  File "C:\Jenkins\vlabus_test\openerp\openerp-server\openerp\addons\hr_holidays\test\hr_holidays_report.yml", line 6, in <module>
    ctx={}
  File "C:\Jenkins\vlabus_test\openerp\openerp-server\openerp\tools\test_reports.py", line 294, in try_report_action
    result = _exec_action(action, datas, context)
  File "C:\Jenkins\vlabus_test\openerp\openerp-server\openerp\tools\test_reports.py", line 278, in _exec_action
    res = try_report(cr, uid, 'report.'+action['report_name'], ids, datas, context, our_module=our_module)
  File "C:\Jenkins\vlabus_test\openerp\openerp-server\openerp\tools\test_reports.py", line 53, in try_report
    res = netsvc.LocalService(rname).create(cr, uid, ids, data, context)
  File "C:\Jenkins\vlabus_test\openerp\openerp-server\openerp\report\interface.py", line 83, in create
    xml = self.create_xml(cr, uid, ids, datas, context)
  File "C:\Jenkins\vlabus_test\openerp\openerp-server\openerp\addons\hr_holidays\report\holidays_summary_report.py", line 203, in create_xml
    date_xml = ''.join(date_xml)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfb in position 15: ordinal not in range(128)

Tags: holidays hr

Related branches

Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello Dieter,

Please provide, which language format you are using ? Because with latest code and with default language , I am not facing any kind of issue.

Thanks & waiting for you answer.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Dieter (dieterb) wrote :

We are using NL_BE as language format.

I suppose he takes French anyway, since the stacktrace shows:
date month="ao\xfbt"

=> août is not getting treated correctly

Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello,

I have checked this issue with nl_BE language format on latest trunk as well as with 7.0, But it seems working fine at all. So, would you please check it again with latest code.

So, currently, I am closing this issue. If you have again this issue, then can reopen it with more information.

Thanks & waiting for your answer.

Changed in openobject-addons:
status: Incomplete → Invalid
Revision history for this message
Hervé Martinet (herve-martinet) wrote :

Related to my duplicate Bug #1217794, I would say that the bug is not because OpenERP locale, but system locale. OpenERP use an UTF8 string returned by strftime("%B") if your system is in UTF8, but this will cause a bug if you use a language with special chars in your system.

If OpenERP is in en_US and no other locale is installed on OpenERP but your linux is in fr_CH, strftime("%B") will return "août" for august in an UTF8 string if system locale is fr_CH.UTF8

To reproduce this bug, launch OpenERP in august with automated tests and before set the system locale :
$ export LANG=fr_CH.UTF-8

The tests will fail, with the last OpenERP revision too !

Revision history for this message
Kalpana Hemnani(SerpentCS) (khemnani-serpentcs) wrote :

Hello Dieter and Hervé,

You guys are right. The problem is with the locale + string management in creating the XSL.

We have been facing the problem and are very near to the solution.

Attached is the report we get now.

We will port the solution soon.

Thanks.

Changed in openobject-addons:
status: Invalid → Confirmed
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Everyone,

This bug exists for sure and the attached merge proposal is the solution we have concluded after the long fought errorts.

We can have several ways to face this problem even using any non-fr, non-be locale.

Hope to get this fixed soon.

Thanks.

Changed in openobject-addons:
status: Confirmed → Fix Committed
importance: Undecided → Low
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: holidays hr
Revision history for this message
Amit Vora(OpenERP) (amit.vora-openerp) wrote :

Hello,

I have attached video.it seems working fine at all in latest 7.0 revision.

Thanks
avo.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.