Why does my code produce an OSError: Not enough disk space?

Uploading: Snipaste_2023-03-16_18-12-33.png…
Uploading: Snipaste_2023-03-16_18-13-38.png…
Please help me confirm what I did wrong. The hard disk on the server still has 100+G, is it because of insufficient memory