-
Notifications
You must be signed in to change notification settings - Fork 62
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
Unable to use tool error this error occurs #35
Comments
Hi, |
@zenython I can't reproduce the error :( |
i think its because of the way of writing syntax in utils.py", line 168 the script is expecting " } " |
yea but its one line if in f string { } section so it shouldnt be an issue |
@zenython try updating python to 3.12.0. |
please let me know if it would work |
I've reverted graphql cop to pre-html reporting feature for now. The tool needs to support not only 3.12 |
There was an issue with fstrings with previous versions of python. I am finishing fix for this :) |
Thanks for the fast response and efforts ! 🙏 |
No problem ;) |
ok lemme see ! |
yes it works now, great thankyou for the efforts 👍❤️ |
No problem 🫡 |
there is a problem again 🥲 |
Hmmm let me check |
its not a problem related to my part of the code so i will need some time to analyze |
can you check for me if this code will work? def curlify(obj):
req = obj['request']
command = "curl -X {method} -H {headers} -d '{data}' '{uri}'"
method = req['method']
uri = req["url"]
if req["body"]:
try:
data = req["body"].decode('UTF-8')
except:
reqb = bytes(req["body"], 'UTF-8')
data = reqb.decode('UTF-8')
else:
data = ''
headers = ['"{0}: {1}"'.format(k, v) for k, v in req["headers"].items()]
headers = " -H ".join(headers)
return command.format(method=method, headers=headers, data=data, uri=uri) please let me know |
Does the issue occur on the 1.12 version as well? |
sorry there i was out of the town ! wait a sec i will check again |
still the error occurs! 🥲 |
hmmm, I guess you are using burp as your proxy. |
yes ! btw you haven't pushed the updated code !? |
can you try changing curlify from utils.py to this code and check it for me ? : def curlify(obj):
print(obj)
req = obj['request']
command = "curl -X {method} -H {headers} -d '{data}' '{uri}'"
method = req['method']
uri = req["url"]
if req["body"]:
try:
data = req["body"].decode('UTF-8')
except:
reqb = bytes(req["body"], 'UTF-8')
data = reqb.decode('UTF-8')
else:
data = ''
headers = ['"{0}: {1}"'.format(k, v) for k, v in req["headers"].items()]
headers = " -H ".join(headers)
return command.format(method=method, headers=headers, data=data, uri=uri) |
okay lemme check |
any updates? :D |
no still the error occurs ! |
And can you provide the output? |
i think python version is creating problem in my pc |
Well it can be but i am testing different versions using github actions. |
Traceback (most recent call last):
File "/home/user/tools/graphql-cop/graphql-cop.py", line 11, in
from lib.tests.info_field_suggestions import field_suggestions
File "/home/user/tools/graphql-cop/lib/tests/info_field_suggestions.py", line 2, in
from lib.utils import graph_query, get_error, curlify
File "/home/user/tools/graphql-cop/lib/utils.py", line 168
'''
^
SyntaxError: f-string: expecting '}'
The text was updated successfully, but these errors were encountered: