Poetry: .poetry/lib/poetry/_vendor/py2.7/subprocess32.py:149: RuntimeWarning:

Created on 28 Feb 2020  路  7Comments  路  Source: python-poetry/poetry

After installing Poetry with:

$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

or

$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3

I see this warning:

$ poetry --version
~/.poetry/lib/poetry/_vendor/py2.7/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
  "program uses threads.", RuntimeWarning)
Poetry version 1.0.3
$ uname -srvmo
Linux 5.3.0-40-generic #32~18.04.1-Ubuntu SMP Mon Feb 3 14:05:59 UTC 2020 x86_64 GNU/Linux

Not sure why there is this warning???

Bug

Most helpful comment

When I downloaded the latest get-poetry.py and installed by python3 get-poetry.py in Ubuntu, same error still occurred.

$ poetry --version
/home/xxx/.poetry/lib/poetry/_vendor/py2.7/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
  "program uses threads.", RuntimeWarning)
Poetry version 1.0.9

I changed get-poetry.py as below (around L.593), this problem was solved.

-        allowed_executables = ["python", "python3"]
+        allowed_executables = ["python3", "python"]

All 7 comments

@babuloseo As mentioned above, it gave the warning as mentioned above, except that it is now poetry version 1.0.5:

$ poetry --version
~/.poetry/lib/poetry/_vendor/py2.7/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
  "program uses threads.", RuntimeWarning)
Poetry version 1.0.5

It is strange that py2.7 is used for a python3 install.

Hello,

both things are described in several issues here. But I took this to investigate the subprocess32 thing a bit more.

There are a few hits about this, when searching the web. It looks like the _posixsubprocess module needs to be compiled during install subprocess32. When vendoring the resulting package, and therefor transport it to a different system than it was compiled, seems to be a problem.

Nevertheless poetry seems to work fine despite of this message. So one could ignore it.

If you really want to get rid of it, I've found a workaround: You have to create your own vendor on the target system:

$ python -m pip install subprocess32 --no-deps --target ~/.poetry/lib/poetry/_vendor/py2.7 --upgrade

One small edit to the get-poetry.py script fixes this:

https://github.com/python-poetry/poetry/pull/1494#discussion_r398169772

Make that change, then invoke python3 get-poetry.py.

  1. download get-poetry.py:

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > get-poetry.py

  1. Edit get-poetry.py on line 200:
    from BIN = """#!/usr/bin/env python to BIN = """#!/usr/bin/env python3

ps. f-string modification doesn't work on Python3.8

My fork addresses this: https://github.com/python-poetry/poetry/pull/2222

Hopefully #2222 or #1494 will get merged.

When I downloaded the latest get-poetry.py and installed by python3 get-poetry.py in Ubuntu, same error still occurred.

$ poetry --version
/home/xxx/.poetry/lib/poetry/_vendor/py2.7/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
  "program uses threads.", RuntimeWarning)
Poetry version 1.0.9

I changed get-poetry.py as below (around L.593), this problem was solved.

-        allowed_executables = ["python", "python3"]
+        allowed_executables = ["python3", "python"]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ulope picture ulope  路  3Comments

alexlatchford picture alexlatchford  路  3Comments

jbarlow83 picture jbarlow83  路  3Comments

nikaro picture nikaro  路  3Comments

AWegnerGitHub picture AWegnerGitHub  路  3Comments