title: How can I fix an `OSError: file error: bad input file` in RDkit with .sdf file?
body: <p>I'm using a third party code in python from an arxiv which use RDkit as a library. It takes a .sdf file with data about chemicals molecules as an argument, but then RDkit throw an error: </p>
  
  <p><code>OSError: File error: Bad input file file.sdf</code> </p>
  
  <p>I followed the instructions, installed all the packages needed, downloaded the files as they said, raise de swap space in my computer because the .sdf is pretty big, strike off a big part of the data of this file... but I can't make it run, none of this tries got success.</p>
  
  <p>I have been looking to the RDkit package and this is the piece of code that raise the error:</p>
  
  <pre><code>LocalForwardSDMolSupplier(std::string filename, bool sanitize, bool removeHs,
                            bool strictParsing) {
    std::istream *tmpStream = nullptr;
    tmpStream = static_cast&lt;std::istream *&gt;(
        new std::ifstream(filename.c_str(), std::ios_base::binary));
    if (!tmpStream || (!(*tmpStream)) || (tmpStream-&gt;bad())) {
      std::ostringstream errout;
      errout &lt;&lt; "Bad input file " &lt;&lt; filename;
      throw RDKit::BadFileException(errout.str());
    }
    dp_inStream = tmpStream;
    df_owner = true;
    df_sanitize = sanitize;
    df_removeHs = removeHs;
    df_strictParsing = strictParsing;
    POSTCONDITION(dp_inStream, "bad instream");
  }
  </code></pre>
  
  <p>It seems to be C++, which I don't know. </p>
  
  <p>I expect to see how this code works, with which inputs and outputs, to adapt to my code. I would like to see with this .sdf file, but maybe another one could work for my purpose.</p>