Zope 2.6.3 and min (...)
I see that "min" and others have been removed from "secure" python (TTW scripts, dtml...). Is this a bug or a VERY BAD idea ? x = _.min([1,2,3,4]) return x Runs perfectly with Zope 2.6.2. but raises this with Zope 2.6.3... Traceback (innermost last): Module ZPublisher.Publish, line 98, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Shared.DC.Scripts.Bindings, line 261, in __call__ Module Shared.DC.Scripts.Bindings, line 292, in _bindAndExec Module Products.PythonScripts.PythonScript, line 311, in _exec Module test, line 1, in test - <PythonScript at /test> - Line 1 AttributeError: min Now I got to make my own "min", "max"... functions or externals to override this or wait for the bugfix :-( Or stay with Zope 2.6.2 -- Gilles
Gilles Lenfant wrote:
I see that "min" and others have been removed from "secure" python (TTW scripts, dtml...). Is this a bug or a VERY BAD idea ?
It's already been submitted to the Collector (at least twice :-) The attache patch, fixes the problem. -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM Skype: colliberty --- DT_Util.py.orig Sat Jan 10 22:58:45 2004 +++ DT_Util.py Sat Jan 10 22:56:43 2004 @@ -58,6 +58,11 @@ else: d[name] = f +from AccessControl.ZopeGuards import guarded_min, guarded_max + +d['min'] = NotBindable(guarded_min) +d['max'] = NotBindable(guarded_max) + if LIMITED_BUILTINS: # Replace certain builtins with limited versions. from RestrictedPython.Limits import limited_builtins
participants (2)
-
Gilles Lenfant -
Johan Carlsson