developer
developer copied to clipboard
error when writing inside folders
I'm getting this all the time. With and Without Modal
IsADirectoryError: [Errno 21] Is a directory: 'generated/src/'
It seems that smol is trying to write directly to the folder, instead to the appropriate file.
hi! hmm. i think i understand - will fix this in the coming version of smol (i am working on #12 )
nice! Thanks for the amazing work, your repo is great!
Got the same error:
IsADirectoryError: [Errno 21] Is a directory: 'generated/app/'
The fix
In the write_file function
Before:
with open(file_path, "w") as file:
# Write content to the file
file.write(filecode)
After:
if not file_path.endswith("/"):
with open(file_path, "w") as file:
# Write content to the file
file.write(filecode)