title: non PyQt module stops working after QApplication start
body: <p>In 2014 I have written a PyQt4 app that used a non PyQt module within and it worked as it should for nearly two years. Now, the non PyQt module had stopped working as expected within PyQt application (I have qt4 and qt5 ports, both share the problem). Below is a sample code to illustrate what is going on:</p>
  
  <pre><code>#! /usr/bin/env python3
  import sys, getopt
  from PyQt5.QtWidgets import QApplication # or PyQt4
  
  # non PyQt module:
  import mymodule
  
  # demo of the mymodule use. It returns nested list
  # with info about objects saved in fname
  
  fname = "/my/file/name"
  res0 = mymodule.getnames(fname)
  # res0 = [[...],...,[...]] the way it should
  #
  app = QApplication(sys.argv)
  ...
  # with or without actual run of the application via
  # app.exec_()
  ...
  res2 = mymodule.getnames(fname)
  # this time the result is:
  # res2 = None
  </code></pre>
  
  <p>Originally, I called the method of mymodule from within PyQt app and it returned the nested list, now it returns None. I have tried to find any explanation or clarification, why the observed behaviour has changed but failed to do so.</p>
  
  <p>I have isolated the code responsible for rendering the mymodule behaviour to the call <code>QApplication([sys.argv])</code> and wondered if anyone has an idea what is going on. What bugs me the most is, that the module is functional before the application start, but after that not any more.</p>
  
  <p>Some further details about mymodule:
  it is a wrapper of a C library written in mymodule.c and installed via the <code>python setup.py install</code> call.</p>
  
  <p>Thank you for any comments in advance!</p>
  
  <p><strong>[Edit] Further informations about mymodule:</strong></p>
  
  <p>mymodule.c code snippet</p>
  
  <pre><code>#include &lt;Python.h&gt;
  #include &lt;extlib.h&gt;
  #include &lt;math.h&gt;
  
  ...
  static PyObject * mymodule_getnames(PyObject *self, PyObject *args)
  {
  char *filename;
  
  if (!PyArg_ParseTuple(args, "s", &amp;filename))
      return NULL;
  FILE *fp = extlib_func(filename);
  ...
  PyObject *names = PyList_New(0);
  ...  
  PyList_Append(names, Py_BuildValue("s", title));
  ...
  return names;
  }
  
  ...
  
  int main(int argc, char *argv[])
  {
  Py_SetProgramName(
  #if PY_MAJOR_VERSION &gt;= 3
                  (wchar_t *)
  #endif
                  argv[0]);
  Py_Initialize();
  return 0;
  }
  </code></pre>