This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Issue with _posixsubprocess when importing subprocess32
Type: Stage: resolved
Components: Cross-Build Versions: Python 2.7
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: Alex.Willmer, gregory.p.smith, paulpaulson
Priority: normal Keywords:

Created on 2017-09-07 15:07 by paulpaulson, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg301589 - (view) Author: paullpaulson (paulpaulson) Date: 2017-09-07 15:07
I am trying to install subprocess32 with my python 2.7 installation via buildroot. It appeared to install correctly but when I import it on the embedded system I get an error:

>>> import subprocess32
/usr/lib/python2.7/site-packages/subprocess32.py:472: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your pro
gram uses threads.
  "program uses threads.", RuntimeWarning)
Following this path I tried to import _posixsubprocess

import _posixsubprocess
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define init function (init_posixsubprocess)
subprocess32 seems to have it's own version and it's not working in this case?

I can use subprocess32 otherwise, tested out basic functionality like subprocess32.Popen(["ls"]).communicate()
msg301600 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2017-09-07 18:05
The standard library in Python 2.7 does not have an associated extension module.  _posixsubprocess comes from subprocess32.

There isn't much point in using subprocess32 on POSIX systems without the _posixsubprocess extension module.

If that import is failing, something in your build for whatever your embedded system is, is not doing the right thing.

as this is subprocess32 only related and not python stdlib subprocess related in Python 3 I suggest using the https://github.com/google/python-subprocess32/issues tracker.  But I don't have enough information to offer much help.

"ImportError: dynamic module does not define init function (init_posixsubprocess)" is very suspicious given that it does: https://github.com/google/python-subprocess32/blob/master/_posixsubprocess.c#L879
History
Date User Action Args
2022-04-11 14:58:52adminsetgithub: 75564
2017-09-07 18:05:19gregory.p.smithsetstatus: open -> closed
messages: + msg301600

assignee: gregory.p.smith
resolution: works for me
stage: resolved
2017-09-07 15:07:15paulpaulsoncreate