← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 847651] [NEW] invalid exception raised in safe_eval

 

Public bug reported:

In tools/safe_eval.py:285, the call to eval() complains about locals_dict not being an iterable, if not set.
Indeed this local variable is initialized to None, whereas a dictionnary is expected.
I'm not sure why the default value is simply not {} instead of None, but at least we should have a "if locals_dict is None: locals_dict={}" in the same way this is done for globals_dict... or is there a reason why it should never happen?

Here's a copy of the exception raised:
  File "/home/user/.../openerp-server-6.0.3/bin/tools/safe_eval.py", line 285, in safe_eval
    return eval(test_expr(expr,_SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
TypeError: 'NoneType' object is not iterable
[2011-09-12 10:56:13,048][...] DEBUG_RPC:exception:u"'NoneType' object is not iterable"

** Affects: openobject-server
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/847651

Title:
  invalid exception raised in safe_eval

Status in OpenERP Server:
  New

Bug description:
  In tools/safe_eval.py:285, the call to eval() complains about locals_dict not being an iterable, if not set.
  Indeed this local variable is initialized to None, whereas a dictionnary is expected.
  I'm not sure why the default value is simply not {} instead of None, but at least we should have a "if locals_dict is None: locals_dict={}" in the same way this is done for globals_dict... or is there a reason why it should never happen?

  Here's a copy of the exception raised:
    File "/home/user/.../openerp-server-6.0.3/bin/tools/safe_eval.py", line 285, in safe_eval
      return eval(test_expr(expr,_SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
    File "", line 1, in <module>
  TypeError: 'NoneType' object is not iterable
  [2011-09-12 10:56:13,048][...] DEBUG_RPC:exception:u"'NoneType' object is not iterable"

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/847651/+subscriptions


Follow ups

References