[trunk] name errors found by pylint

Bug #1050267 reported by Alexandre Fayolle - camptocamp
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Confirmed
Medium
OpenERP's Framework R&D

Bug Description

Hello,

I ran pylint on the trunk server code, and it found a few bugs (I've doubled checked them for false positives, and these seem genuine, unless openerp is doing weird things with the namespaces under the cover):

************* Module openerp.report.render.rml2txt.rml2txt
E0602:423,71:_rml_template.set_next_template: Undefined variable 'name'
************* Module openerp.report.render.rml2html.rml2html
E0602:323,71:_rml_template.set_next_template: Undefined variable 'name'
************* Module openerp.addons.base.module.wizard.base_module_scan
E0602: 41,19:base_module_scan.watch_dir: Undefined variable 'module_name_re'
************* Module openerp.addons.base.ir.ir_model_constraint
E0602: 41,18:ir_model_constraint._module_data_uninstall: Undefined variable 'except_orm'
E0602: 41,29:ir_model_constraint._module_data_uninstall: Undefined variable '_'
E0602: 41,54:ir_model_constraint._module_data_uninstall: Undefined variable '_'
************* Module openerp.addons.base.ir.ir_model_relation
E0602: 33,18:ir_model_relation._module_data_uninstall: Undefined variable 'except_orm'
E0602: 33,29:ir_model_relation._module_data_uninstall: Undefined variable '_'
E0602: 33,54:ir_model_relation._module_data_uninstall: Undefined variable '_'

The following one is probably a false positive, but I'm awkward in relying in a variable leaking from a genexp. Also in this code, you don't provide the user with the full list of modules which cannot be uninstalled because of the presence of module data, which means that the user will have to unselect them one by one, which makes for poor user XP, so it probably deserves being rewritten by filling up a list with models matching the faulty condition.

************* Module openerp.addons.base.ir.ir_model
E0602:158,104:ir_model.unlink: Undefined variable 'model'

The last one is a requirement for a cleanup of an outdated if __name__ == "__main__" section:

************* Module openerp.tools.amount_to_text_en
E0602:127,27: Undefined variable 'int_to_text'
E0602:129,27: Undefined variable 'int_to_text'
E0602:131,14: Undefined variable 'int_to_text'

For the record the command line that I used is:

PYTHONPATH=.:openerp -rn -iy -dE,W,R,C,F -eE0602 openerp

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

I suspect that some of these may also be present in stable, esp. the ones in openerp.report. It can't hurt to double check.

Revision history for this message
xrg (xrg) wrote : Re: [Bug 1050267] [NEW] [trunk] name errors found by pylint

On Thursday 13 September 2012, you wrote:
> Public bug reported:
>
> Hello,
>
> I ran pylint on the trunk server code, and it found a few bugs
> ....

The ones at rml2txt have been fixed in F3, as of Jan 1, 2012.

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

glad to hear this. I assume F3 is a branch somewhere. What's the URL ?

Revision history for this message
xrg (xrg) wrote : Re: [Bug 1050267] Re: [trunk] name errors found by pylint

On Thursday 13 September 2012, you wrote:
> glad to hear this. I assume F3 is a branch somewhere. What's the URL ?

https://github.com/xrg/openerp-server

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

Some of these are fixed in https://code.launchpad.net/~c2c/openobject-server/trunk-proposed-cleanups

* openerp.addons.base.ir.ir_model_constraint
* openerp.addons.base.ir.ir_model_relation
* openerp.tools.amount_to_text_en

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Medium
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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