[6.0 rc2] export translation fails with error

Bug #700770 reported by Bogdan Stanciu
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

Export translation fails:

[2011-01-09 19:46:16,890][bs_test03_fr] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/base/module/wizard/base_export_language.py", line 50, in act_getfile
    tools.trans_export(this.lang, mods, buf, this.format, dbname=cr.dbname)
TypeError: trans_export() got an unexpected keyword argument 'dbname'

Related branches

Vo Minh Thu (thu)
Changed in openobject-server:
milestone: none → 6.0
status: New → Fix Released
Revision history for this message
Felix Schubert (input-fescon) wrote :

The patch raises:

File "/usr/local/lib/python2.6/dist-packages/openerp-server/tools/translate.py", line 317, in next
    raise Exception("malformed file: bad line: %s" % line)

Revision history for this message
Felix Schubert (input-fescon) wrote :

This is the complete Traceback:

Traceback (most recent call last):
  File "./openerp-server.py", line 121, in <module>
    db,pool = pooler.get_db_and_pool(dbname, update_module=tools.config['init'] or tools.config['update'], pooljobs=False)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/pooler.py", line 39, in get_db_and_pool
    addons.load_modules(db, force_demo, status, update_module)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/__init__.py", line 835, in load_modules
    processed_modules.extend(load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report))
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/__init__.py", line 774, in load_module_graph
    modobj.update_translations(cr, 1, [mid], None)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/base/module/module.py", line 514, in update_translations
    tools.trans_load(cr, f, lang, verbose=False, context=context2)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/tools/translate.py", line 841, in trans_load
    r = trans_load_data(cr, fileobj, fileformat, lang, verbose=verbose, context=context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/tools/translate.py", line 890, in trans_load_data
    for row in reader:
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/tools/translate.py", line 317, in next
    raise Exception("malformed file: bad line: %s" % line)
Exception: malformed file: bad line: <<<<<<< TREE

Revision history for this message
Vo Minh Thu (thu) wrote :

Felix Schubert,

The exception seems to be raised because you're reading a malformed .po file: the line
  <<<<<<< TREE
seems to be present in the file (probably after a failed merge of translation file).

Can you provide more information about what you were doing when you got that exception and why you think the patch was at fault here?

Revision history for this message
Bogdan Stanciu (bstanciu) wrote : Re: [Bug 700770] Re: [6.0 rc2] export translation fails with error

On 10. 01. 11 10:41, Felix Schubert wrote:
> This is the complete Traceback:
>
> Traceback (most recent call last):
> File "./openerp-server.py", line 121, in <module>
> db,pool = pooler.get_db_and_pool(dbname, update_module=tools.config['init'] or tools.config['update'], pooljobs=False)
> File "/usr/local/lib/python2.6/dist-packages/openerp-server/pooler.py", line 39, in get_db_and_pool
> addons.load_modules(db, force_demo, status, update_module)
> File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/__init__.py", line 835, in load_modules
> processed_modules.extend(load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report))
> File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/__init__.py", line 774, in load_module_graph
> modobj.update_translations(cr, 1, [mid], None)
> File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/base/module/module.py", line 514, in update_translations
> tools.trans_load(cr, f, lang, verbose=False, context=context2)
> File "/usr/local/lib/python2.6/dist-packages/openerp-server/tools/translate.py", line 841, in trans_load
> r = trans_load_data(cr, fileobj, fileformat, lang, verbose=verbose, context=context)
> File "/usr/local/lib/python2.6/dist-packages/openerp-server/tools/translate.py", line 890, in trans_load_data
> for row in reader:
> File "/usr/local/lib/python2.6/dist-packages/openerp-server/tools/translate.py", line 317, in next
> raise Exception("malformed file: bad line: %s" % line)
> Exception: malformed file: bad line: <<<<<<< TREE
>
Dear Felix,

I do not have this error...

are you sure you don't have a "bad line" in your file?

regards
bogdan

Revision history for this message
Felix Schubert (input-fescon) wrote :

Dear Bogdan,

you were right - it was a bzr conflict with my local translation ;-)

Thank you

Felix

Revision history for this message
Sam http://www.smile.fr (samir-rachedi) wrote :

the tools.trans_export is called with dbname parameter instead cr paremeter.

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.