Skip to content
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

OSError: [Errno 24] Too many open files #3

Open
kafka-91 opened this issue Oct 7, 2013 · 1 comment
Open

OSError: [Errno 24] Too many open files #3

kafka-91 opened this issue Oct 7, 2013 · 1 comment

Comments

@kafka-91
Copy link

kafka-91 commented Oct 7, 2013

Hi,

I am trying to convert quite a lot of m4a files into mp3 files with the following piece of code:

for root,dirs,files in os.walk("/Users/jonathan/Desktop/Music1"): 
    for file1 in files:
        if file1[len(file1)-3:len(file1)] == "m4a":
            input1 = Input("/Users/jonathan/Desktop/Music1/"+file1)
            codec = AudioCodec("libmp3lame")
            output = Output("/Users/jonathan/Desktop/MP3/"+file1[0:len(file1)-3]+"mp3", codec) #replace the path
            ffmpeg = FFmpeg("ffmpeg", input1, output)
            ffmpeg.run()

It works fine until a certain point, when it crashes and shows the following message:
Traceback (most recent call last): File "antomp3.py", line 18, in <module> ffmpeg.run() File "/Users/jonathan/anaconda/lib/python2.7/site-packages/ffmpegwrapper-0.1_dev-py2.7.egg/ffmpegwrapper/ffmpeg.py", line 158, in run return FFmpegProcess(self).run() File "/Users/jonathan/anaconda/lib/python2.7/site-packages/ffmpegwrapper-0.1_dev-py2.7.egg/ffmpegwrapper/ffmpeg.py", line 97, in run stdin=PIPE, stdout=PIPE, stderr=STDOUT) File "/Users/jonathan/anaconda/lib/python2.7/subprocess.py", line 711, in __init__ errread, errwrite) File "/Users/jonathan/anaconda/lib/python2.7/subprocess.py", line 1197, in _execute_child errpipe_read, errpipe_write = self.pipe_cloexec() File "/Users/jonathan/anaconda/lib/python2.7/subprocess.py", line 1153, in pipe_cloexec r, w = os.pipe() OSError: [Errno 24] Too many open files

I've been reading about this error message on the web and it seems that it is a problem of not closing the files opened through Popen(). Can you help me fix this?

@interru
Copy link
Owner

interru commented Oct 14, 2013

Sorry I was/am kind of busy but I will look into it in a few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants