developer
developer copied to clipboard
Characters like `+` throws parsing error
Running python main_no_modal.py
with prompt including characters like ;
and :
would throw the following error, seems to be related to one of the parsing (.lstrip(" \t")
).
Edit: After some experimentation, it seems like it is the character +
instead.
Traceback (most recent call last):
File "~/Desktop/developer/main_no_modal.py", line 230, in <module>
main(prompt, directory, file)
File "~/Desktop/developer/main_no_modal.py", line 135, in main
list_actual = ast.literal_eval(filepaths_string)
File "/usr/lib/python3.10/ast.py", line 62, in literal_eval
node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')
File "/usr/lib/python3.10/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 1
- /src/index.js
^
SyntaxError: invalid syntax
Just for reproducibility:
- install the dependencies
- export the OpenAI API Key
- run
python main_no_modal.py "a react app that is luxurious and dark-themed, offering a simple form to RSVP to the wedding; Form has following fields: first name, last name, checkbox indicating a +1"
-> this will not work and will throw the earlier error - run
python main_no_modal.py "a react app that is luxurious and dark-themed, offering a simple form to RSVP to the wedding."
-> this will work.