RestrictedPython | restricted execution environment for Python to run

 by   zopefoundation Python Version: 7.2a1.dev0 License: Non-SPDX

kandi X-RAY | RestrictedPython Summary

kandi X-RAY | RestrictedPython Summary

RestrictedPython is a Python library. RestrictedPython has no bugs, it has no vulnerabilities, it has build file available and it has low support. However RestrictedPython has a Non-SPDX License. You can install using 'pip install RestrictedPython' or download it from GitHub, PyPI.

A restricted execution environment for Python to run untrusted code.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              RestrictedPython has a low active ecosystem.
              It has 312 star(s) with 34 fork(s). There are 78 watchers for this library.
              There were 2 major release(s) in the last 12 months.
              There are 12 open issues and 68 have been closed. On average issues are closed in 150 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of RestrictedPython is 7.2a1.dev0

            kandi-Quality Quality

              RestrictedPython has 0 bugs and 0 code smells.

            kandi-Security Security

              RestrictedPython has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              RestrictedPython code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              RestrictedPython has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              RestrictedPython releases are not available. You will need to build from source code and install.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              RestrictedPython saves you 2050 person hours of effort in developing the same functionality from scratch.
              It has 3898 lines of code, 440 functions and 58 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed RestrictedPython and discovered the below as its top functions. This is intended to give you an instant insight into RestrictedPython implemented functionality, and help decide if they suit your requirements.
            • Return astroid Assign node
            • Raise an exception
            • Add an error node
            • Raise an error if node is not allowed
            • Return node assignment
            • Return an ast_spec for tpl
            • Protect a sequence
            • Visit a subscript node
            • Transform a slice expression
            • Return a starred node
            • Check function definition
            • Return an expression node
            • Return list comprehension
            • Return node s representation
            • Return a comprehension
            • Return an ExtSlice node
            • Unpacks a sequence
            • Return node comprehension
            • Handles assignment expressions
            • Visit an attribute node
            • Modify call node
            • Return astroid Name node
            • Return a wrapped function that wraps the object
            • Visit a class node by returning a fresh instance of it
            • Visit the module
            • Replace with
            Get all kandi verified functions for this library.

            RestrictedPython Key Features

            No Key Features are available at this moment for RestrictedPython.

            RestrictedPython Examples and Code Snippets

            No Code Snippets are available at this moment for RestrictedPython.

            Community Discussions

            QUESTION

            Restrictedpython code evaluation executed in thread pool - function invoked twice
            Asked 2021-Mar-20 at 22:20

            i'm using restrictedpython in my app in order to allow the "mid-skilled-user" to develop some pieces of additional code to execute as modular on-the-fly add-on.

            For some architectural constraints, i have to use a thread pool in order to parallelize the code execution.

            Those threads are created by group of 10, then started and wait to be join on the main execution process.

            I'm experiencing some weird issues...sometimes, i see that the restrictedpython thread is runned twice!...i've looked around and i'm a bit surprised that no-one was talking about that, i don't know if there is something wrong in my code or if the restrictedpython is not thread safe.

            Anyway, you can see that in my RestrictedPythonThread i'm also implementing Mutex lock after compiling the restrictedpython code and then releasing the Mutex lock before i have the compiled code.

            Then, the compiled code is executed without any lock using a simple eval.

            Here is my code:

            ...

            ANSWER

            Answered 2021-Mar-20 at 22:20

            After digging around i've find that using python redis queue the issue went away...so this was definively an issue related to the shared memory space of threads.

            Maybe using built-in multiprocess module can be enough, but i haven't tested it because in my application i have already python-rq in use.

            Source https://stackoverflow.com/questions/66716420

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install RestrictedPython

            You can install using 'pip install RestrictedPython' or download it from GitHub, PyPI.
            You can use RestrictedPython like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install RestrictedPython

          • CLONE
          • HTTPS

            https://github.com/zopefoundation/RestrictedPython.git

          • CLI

            gh repo clone zopefoundation/RestrictedPython

          • sshUrl

            git@github.com:zopefoundation/RestrictedPython.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Python Libraries

            public-apis

            by public-apis

            system-design-primer

            by donnemartin

            Python

            by TheAlgorithms

            Python-100-Days

            by jackfrued

            youtube-dl

            by ytdl-org

            Try Top Libraries by zopefoundation

            ZODB

            by zopefoundationPython

            Zope

            by zopefoundationPython

            zope.interface

            by zopefoundationPython

            z3c.rml

            by zopefoundationPython

            bobo

            by zopefoundationPython