no error when loading a custom module with a syntax error

Bug #1055572 reported by Marcos Mendez
10
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

When creating a new custom module, if there is a syntax error there is no way to determine why the module was not loaded. For example:

{
"name": "OpenAcademy",
"version": "1.0",
"depends": ["base"],
"author": "Author Name",
"category": "Category",
"description": """Description text""",
"data", [],
"demo": [],
"test": [],
"installable": True,
"auto_install": False,
}

When you go to update the module list and it will not be listed. Also when running the server with debug on, you will not see any errors.

Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello Marcos Mendez ,

I have faced a trackback of invalid syntax.
So would you please check this again and elaborate
more regarding this issue.

Traceback (most recent call last):
  File "/home/jacky/workspace/Project/MY/trunk6/server/openerp/service/__init__.py", line 55, in load_server_wide_modules
    openerp.modules.module.load_openerp_module(m)
  File "/home/jacky/workspace/Project/MY/trunk6/server/openerp/modules/module.py", line 425, in load_openerp_module
    getattr(sys.modules['openerp.addons.' + module_name], info['post_load'])()
  File "/home/jacky/workspace/Project/MY/trunk6/new_openerp-web/addons/web/__init__.py", line 29, in wsgi_postload
    app = common.http.Root(o)
  File "/home/jacky/workspace/Project/MY/trunk6/new_openerp-web/addons/web/common/http.py", line 482, in __init__
    static_dirs = self._load_addons()
  File "/home/jacky/workspace/Project/MY/trunk6/new_openerp-web/addons/web/common/http.py", line 540, in _load_addons
    manifest = ast.literal_eval(open(manifest_path).read())
  File "/usr/lib/python2.7/ast.py", line 49, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/usr/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 63
    'data', [
          ^
SyntaxError: invalid syntax

Thanks and waiting for reply!

Changed in openobject-server:
status: New → Incomplete
Revision history for this message
Marcos Mendez (marcos-hr7) wrote : Re: [Bug 1055572] Re: no error when loading a custom module with a syntax error

Sorry for the delay. When trying to load the module for the first time
(before installing), using the update module list functionality, there is
no way to know what happened to a new module if it has some sort of error.
After you load it, if there's an error (e.g. after an update) then of
course openerp doesn't start.

Regards,
Marcos

On Wed, Sep 26, 2012 at 2:45 AM, Jignesh Rathod(OpenERP) <
<email address hidden>> wrote:

> Hello Marcos Mendez ,
>
> I have faced a trackback of invalid syntax.
> So would you please check this again and elaborate
> more regarding this issue.
>
> Traceback (most recent call last):
> File
> "/home/jacky/workspace/Project/MY/trunk6/server/openerp/service/__init__.py",
> line 55, in load_server_wide_modules
> openerp.modules.module.load_openerp_module(m)
> File
> "/home/jacky/workspace/Project/MY/trunk6/server/openerp/modules/module.py",
> line 425, in load_openerp_module
> getattr(sys.modules['openerp.addons.' + module_name],
> info['post_load'])()
> File
> "/home/jacky/workspace/Project/MY/trunk6/new_openerp-web/addons/web/__init__.py",
> line 29, in wsgi_postload
> app = common.http.Root(o)
> File
> "/home/jacky/workspace/Project/MY/trunk6/new_openerp-web/addons/web/common/http.py",
> line 482, in __init__
> static_dirs = self._load_addons()
> File
> "/home/jacky/workspace/Project/MY/trunk6/new_openerp-web/addons/web/common/http.py",
> line 540, in _load_addons
> manifest = ast.literal_eval(open(manifest_path).read())
> File "/usr/lib/python2.7/ast.py", line 49, in literal_eval
> node_or_string = parse(node_or_string, mode='eval')
> File "/usr/lib/python2.7/ast.py", line 37, in parse
> return compile(source, filename, mode, PyCF_ONLY_AST)
> File "<unknown>", line 63
> 'data', [
> ^
> SyntaxError: invalid syntax
>
> Thanks and waiting for reply!
>
>
> ** Changed in: openobject-server
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1055572
>
> Title:
> no error when loading a custom module with a syntax error
>
> Status in OpenERP Server:
> Incomplete
>
> Bug description:
>
> When creating a new custom module, if there is a syntax error there is
> no way to determine why the module was not loaded. For example:
>
>
> {
> "name": "OpenAcademy",
> "version": "1.0",
> "depends": ["base"],
> "author": "Author Name",
> "category": "Category",
> "description": """Description text""",
> "data", [],
> "demo": [],
> "test": [],
> "installable": True,
> "auto_install": False,
> }
>
> When you go to update the module list and it will not be listed. Also
> when running the server with debug on, you will not see any errors.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-server/+bug/1055572/+subscriptions
>

Revision history for this message
Marcos Mendez (marcos-hr7) wrote :
Download full text (3.2 KiB)

Hi,

More information:

server bzr revno: 4186
addons bzr revno: 6823

I'm using a VM provided to me during an OpenERP training currently in
progress.

Regards,
Marcos

On Wed, Sep 26, 2012 at 3:14 PM, Marcos Mendez <email address hidden> wrote:

> Sorry for the delay. When trying to load the module for the first time
> (before installing), using the update module list functionality, there is
> no way to know what happened to a new module if it has some sort of error.
> After you load it, if there's an error (e.g. after an update) then of
> course openerp doesn't start.
>
> Regards,
> Marcos
>
> On Wed, Sep 26, 2012 at 2:45 AM, Jignesh Rathod(OpenERP) <
> <email address hidden>> wrote:
>
>> Hello Marcos Mendez ,
>>
>> I have faced a trackback of invalid syntax.
>> So would you please check this again and elaborate
>> more regarding this issue.
>>
>> Traceback (most recent call last):
>> File
>> "/home/jacky/workspace/Project/MY/trunk6/server/openerp/service/__init__.py",
>> line 55, in load_server_wide_modules
>> openerp.modules.module.load_openerp_module(m)
>> File
>> "/home/jacky/workspace/Project/MY/trunk6/server/openerp/modules/module.py",
>> line 425, in load_openerp_module
>> getattr(sys.modules['openerp.addons.' + module_name],
>> info['post_load'])()
>> File
>> "/home/jacky/workspace/Project/MY/trunk6/new_openerp-web/addons/web/__init__.py",
>> line 29, in wsgi_postload
>> app = common.http.Root(o)
>> File
>> "/home/jacky/workspace/Project/MY/trunk6/new_openerp-web/addons/web/common/http.py",
>> line 482, in __init__
>> static_dirs = self._load_addons()
>> File
>> "/home/jacky/workspace/Project/MY/trunk6/new_openerp-web/addons/web/common/http.py",
>> line 540, in _load_addons
>> manifest = ast.literal_eval(open(manifest_path).read())
>> File "/usr/lib/python2.7/ast.py", line 49, in literal_eval
>> node_or_string = parse(node_or_string, mode='eval')
>> File "/usr/lib/python2.7/ast.py", line 37, in parse
>> return compile(source, filename, mode, PyCF_ONLY_AST)
>> File "<unknown>", line 63
>> 'data', [
>> ^
>> SyntaxError: invalid syntax
>>
>> Thanks and waiting for reply!
>>
>>
>> ** Changed in: openobject-server
>> Status: New => Incomplete
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1055572
>>
>> Title:
>> no error when loading a custom module with a syntax error
>>
>> Status in OpenERP Server:
>> Incomplete
>>
>> Bug description:
>>
>> When creating a new custom module, if there is a syntax error there is
>> no way to determine why the module was not loaded. For example:
>>
>>
>> {
>> "name": "OpenAcademy",
>> "version": "1.0",
>> "depends": ["base"],
>> "author": "Author Name",
>> "category": "Category",
>> "description": """Description text""",
>> "data", [],
>> "demo": [],
>> "test": [],
>> "installable": True,
>> "auto_install": False,
>> }
>>
>> When you go to update the module list and it will not be listed. Also
>> when running the server with debug on, you will not see any errors.
>>
>> To manage notifications about this bug go to:
>> ht...

Read more...

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Medium
status: Incomplete → Confirmed
Revision history for this message
Dairon Medina Caro (codeadict) wrote :

I have the same issue , i think is a problem of old python versions, the error is on ast.py module of core Python. The error happens for me on python 2.6 with ast.__version__ = 62047. Doesn't happens when have Python 2.7 on Fedora. I will Try on a virtualenv and share the results when done.

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.