title: python - subprocess length limit
body: <p>I have to create an email from a python script calling:</p>
  
  <pre class="lang-python prettyprint-override"><code>subprocess.call([
      'thunderbird',
      '-compose',
      "preselectid='{}',to='{}',cc='{}',subject='{}',body='{}'".format(
          preselectid, to, cc, subject, body),
      ])
  </code></pre>
  
  <p>but the email is truncate when the <code>body</code> is "too" large.</p>
  
  <p>I know that on Windows there is a limit of 32,768 char (<a href="https://stackoverflow.com/questions/2381241/what-is-the-subprocess-popen-max-length-of-the-args-parameter">What is the subprocess.Popen max length of the args parameter?</a>) but I'm on Linux (using zsh) and when echoing the string with</p>
  
  <pre class="lang-python prettyprint-override"><code>subprocess.call([
      'echo',
      "preselectid='{}',to='{}',cc='{}',subject='{}',body='{}'".format(
          preselectid, to, cc, subject, body),
      ])
  </code></pre>
  
  <p>I get the complete and correct email content.</p>
  
  <p>How can I solve this problem?</p>
  
  <p>EDIT:
  Thanks to @slezica I've found out that copy-pasting the generated email and running the command from command-line I get, anyway, the truncated email (at the 32,303 char).
  The problem is <code>thunderbird</code>.</p>