1 Like
Interesting. It needs a help feature, which should, e.g., list the available languages.
There's already a menu which you can select a language from.
Right now there's an bug with executing C/C++ code
[2020-09-23 21:51:52,786] ERROR in app: Exception on /execute [GET]
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "main.py", line 35, in execute
result = gfg_compile(lang, code, stdin)
File "/home/runner/geeksforgeeks-api/gfg_api.py", line 13, in gfg_compile
submissionData = req.json()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
172.18.0.1 - - [23/Sep/2020 21:51:52] "
Very interesting
Are you running the server that executes the requests?
I had that problem with Java too, but plus signs should be correctly encoded (I used the encodeURI() function).
OK; I think I see the problem. The encodeURI() function keeps plus signs the same, but when the server sees it, it interprets it as a space.
Replace all instances of +
with %2B
.
2 Likes
Apparently encodeURI() doesn't take in the fact that you're sending a querystring but encodeURIComponent does