UnicodeEncodeError in ir_cron code due to jobs name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Confirmed
|
Low
|
OpenERP's Framework R&D |
Bug Description
Hello,
This bug was reproduced on the last commit of openerp-6.1 branch of this morning (2012-05-01).
Yet another unicode error. 'threading.Thread' await a 'name' argument that should be already encoded (or convertible to ascii). Bad luck, it's job["name"] we are feeding in and this is unicode.
And this will silently pass until you provide a unicode string that contains devils characters.
2012-05-01 13:22:00,029 6775 WARNING ? openerp.
Traceback (most recent call last):
File "/home/
task_thread = threading.
File "/opt/apps/
self.__name = str(name or _newname())
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 18: ordinal not in range(128)
Solution seems easy here:
job['name'
is better than job['name'].
To reproduce, install subscription module, and account, create a subscription type on account.invoice, then a subscription, and put an accentuated character in the name of the subscription: it'll be copied as the name of the ir_cron job.
Put the according date in ir_cron so that it'll be triggered soon. Then switch watch your openobject-server logs.
Related branches
- OpenERP Core Team: Pending requested
-
Diff: 18 lines (+2/-2)1 file modifiedopenerp/addons/base/ir/ir_cron.py (+2/-2)
summary: |
- UnicodeEncodeError cron + UnicodeEncodeError in ir_cron code due to jobs name |
Changed in openobject-server: | |
assignee: | nobody → OpenERP's Framework R&D (openerp-dev-framework) |
importance: | Undecided → Low |
status: | New → Confirmed |
Well, I guess this shows my lack of knowledge of the functional part of openerp...
Here is a much simpler way to reproduce:
Install a clean empty database, get the extended interface, and go in Settings / Configuration / Scheduler / Scheduled Actions
Edit one of them and add an UTF-8 char as "é" in the name of the Scheduled Action. Change time of next execution to match a near future. Wait. And Bang.