RestrictedPython icon indicating copy to clipboard operation
RestrictedPython copied to clipboard

bytearray support?

Open jsmith173 opened this issue 1 year ago • 1 comments

It seems bytearray is not supported. How can I fix it myself?

image

jsmith173 avatar Mar 17 '24 12:03 jsmith173

@jsmith173 RestrictedPython itself offers several sets of builtins to use with, but you can always add additional elements for your specific use-case. Details: https://github.com/zopefoundation/RestrictedPython/blob/master/src/RestrictedPython/Guards.py#L14-L16

Just extend your globals to use it, if you use the safe_builtins from Guards, add it as another element (extend safe_names and add it to the used builtins: see: https://github.com/zopefoundation/RestrictedPython/blob/master/src/RestrictedPython/Guards.py#L111-L112).

loechel avatar Mar 18 '24 19:03 loechel