-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permission denied #36
Comments
PermissionError: [Errno 13] Permission denied: './private.py' |
ok so a self solve # web imports
from flask import Flask
from flask_executor import Executor
from flask_shell2http import Shell2HTTP
# Flask application instance
app = Flask(__name__)
# application factory
executor = Executor(app)
shell2http = Shell2HTTP(app, executor, base_url_prefix="/scripts/")
shell2http.register_command(endpoint="hacktheplanet", command_name="python3 ./fuxsocy.py")
# Application Runner
if __name__ == "__main__":
app.testing = True
c = app.test_client()
"""
The final executed command becomes:
```bash
$ ./fuxsocy.py
```
"""
uri = "/scripts/hacktheplanet"
resp1 = c.post(uri, json={"args": []}).get_json()
print(resp1)
# fetch result
result_url = resp1["result_url"]
resp2 = c.get(result_url).get_json()
print(resp2) this is how your script should be than the contents of the py like so import os
import sys
print(2*2) and return code proving the example is flat out not working {"end_time":1635766722.6711774,"error":"","key":"5bb35ab3","process_time":0.012186288833618164,"report":"4\n","returncode":0,"start_time":1635766722.658991} so the problem is you were passing a python script to bash with no Interpreter |
Hey!
The reason you are getting
If a python file includes the shebang statement ( Of course your solution is fine too and maybe even better for the sake of simplicity. |
nope tht was not it i have no permission errors simply like i showed you above when calling python via bash it needs to be prefixed with python3 the permission error was due to not using python3 before the fuxsocy.py file go figure it works though but u make a good point shhh dont tell anyone i forgot my shebangs plz |
Question why am i getting a permission denied error on one of your example scripts for running a post to a python file
no need to give any example other than it dont work lol
The text was updated successfully, but these errors were encountered: