title: How to IPC between node and python using posix message queue?
body: <p>I'm trying to write a &quot;hello world&quot; of IPC between a node js and a python<strong>3</strong> application. At the moment I'm having a parse error when a new message arrives the Python app. The codes are:</p>
  <p>Python:</p>
  <pre><code>from ipcqueue import posixmq
  from time import sleep
  
  q1 = posixmq.Queue('/fila1')
  
  while True:
  
      while q1.qsize() &gt; 0:
          print('p1: Recebi na minha fila: ' + str(q1.get()))
  
      sleep(0.5)
  </code></pre>
  <p>Node:</p>
  <pre><code>const PosixMQ = require('posix-mq')
  
  var mq = new PosixMQ();
  mq.open({
      name: '/fila1',
      create: true,
      mode: '0777',
      maxmsgs: 10,
      msgsize: 11
  });
  mq.push(&quot;hello world&quot;)
  mq.close();
  </code></pre>
  <p>When the second app sends the message, the python app fails with:</p>
  <blockquote>
  <p>File &quot;../test-fila1.py&quot;, line 9, in </p>
  <pre><code>print('p1: Recebi na minha fila: ' + str(q1.get()))   File &quot;/usr/lib/python3.7/site-packages/ipcqueue/posixmq.py&quot;, line 174, in
  </code></pre>
  <p>get</p>
  <pre><code>return self._serializer.loads(data)   File &quot;/usr/lib/python3.7/site-packages/ipcqueue/serializers.py&quot;, line 14,
  </code></pre>
  <p>in loads</p>
  <pre><code>return pickle.loads(data) KeyError: 101
  </code></pre>
  <p>[2]-  Exit 1                  python3 ../test-fila1.py
  [3]+  Done                    node index.js</p>
  </blockquote>
  <p><strong>EDIT</strong><br>
  So, I decided to change the question from &quot;KeyError: 101 when loading ipc message between node and python apps&quot; to &quot;How to IPC between node and python using posix message queue?&quot; because I just noticed that the sample code I posted generates different errors everytime I run them. Now the error that is happening is (however, no code was changed):</p>
  <blockquote>
  <p>Traceback (most recent call last):   File &quot;snippets/test-fila1.py&quot;,<br>
  line 9, in <br>
  print('p1: Recebi na minha fila: ' + str(q1.get()))   File &quot;/usr/lib/python3.7/site-packages/ipcqueue/posixmq.py&quot;, line 174, in<br>
  get<br>
  return self._serializer.loads(data)   File &quot;/usr/lib/python3.7/site-packages/ipcqueue/serializers.py&quot;, line 14,<br>
  in loads<br>
  return pickle.loads(data)<br>
  _pickle.UnpicklingError: unpickling stack underflow</p>
  </blockquote>