Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

Python occasional "Unexpected error: [Errno 9] Bad file descriptor"

Thu Mar 05, 2020 9:49 pm

I have a batch python script that successfully runs through 22 images at a time, then crashes with the error "Unexpected error: [Errno 9] Bad file descriptor". After pointing it to the next set of images it continues for 22 more. Etc. ... Am I failing to properly dispose garbage or something?

Python plugin attached

Re: Python occasional "Unexpected error: [Errno 9] Bad file descriptor

Thu Mar 05, 2020 9:54 pm

Hello opusGlass.
I can't help you with this,
but there are a few really good coders here who can.

Re: Python occasional "Unexpected error: [Errno 9] Bad file descriptor

Fri Mar 06, 2020 8:19 am

Since you appear to be on Windows, I would first remove/comment out all the "print" statements. When their accumulated output reaches 4K bad things happen (running the code gimp-console could alleviate this, too).

Re: Python occasional "Unexpected error: [Errno 9] Bad file descriptor

Fri Mar 06, 2020 11:07 pm

That was it! I noticed that it runs perfectly when pasted into the console but I didn't realize it was related to the print statements. Removing them fixes everything. Thanks!
Post a reply