title: OSError: [Errno 63] File name too long
body: <p>I have a short script that needs to merge multiple MKV files into one every night.</p>
  <pre><code>import os, glob
  import subprocess
  
  concatenated_files = &quot;&quot;
  
  os.chdir(&quot;/cams/&quot;)
  for index, file in enumerate(glob.glob(&quot;*.mkv&quot;)):
      if index == 0:
          concatenated_files = file
      else:
          concatenated_files += &quot; + &quot; + file
  
  # print(concatenated_files)
  
  returncode = subprocess.call(&quot;mkvmerge -o out.mkv &quot; + concatenated_files)
  </code></pre>
  <p>I am getting the following error with just a few files</p>
  <pre><code>OSError: [Errno 63] File name too long: 'mkvmerge -o out.mkv video21-06-28_09-12-08-51.mkv + video21-06-28_07-55-36-80.mkv + video21-06-28_09-52-05-79.mkv + video21-06-28_08-47-56-69.mkv + video21-06-28_09-15-04-34.mkv + video21-06-28_09-32-43-25.mkv
  </code></pre>
  <p>I am planning to merge hundreds of them, so not really sure how to sort this situation with Python. It works well from the shell.</p>