Terry J. Reedy added the comment:

There are certainly some problems with subprocess on Windows.
Note .../python34> pip pyflakes  installs in a second or two.
...> pyflakes -h  # Windows Command Propmpt WCP
>>> import subprocess as s; s.check_output("pyflakes -h")
console interpreter CI or Idle, all produce help output

WCP> pyflakes c:\programs\python34\lib\turtle.py  # or / instead of \
c:\programs\python34\lib\turtle.py:572: local variable 'rgb' is assigned to but 
never used
... 50+ lines (all < 1/2 second)
c:\programs\python34\lib\turtle.py:4139: undefined name 'exitonclick'

CI>>> s.check_output("pyflakes c:\programs\python34\lib\turtle.py")
pause, so almost think is hanging, then

c:\programs\python34\lib\lib2to3\tests\data\bom.py:2:17: invalid syntax print 
"BOM BOOM!"
...100 more error for various files.
pyflakes ignores file name given and checks entire stdlib.

ID>>> s.check_output("pyflakes c:\programs\python34\lib\turtle.py")
hangs indefinitely, no output

CI or ID >>> s.check_output("pyflakes c:/programs/python34/lib/turtle.py")  # / 
instead of \ which was ok in WCP
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "F:\Python\dev\5\py35\lib\subprocess.py", line 627, in check_output
    raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command 'pyflakes c:/programs/python34/lib/turtle
.py' returned non-zero exit status 1

Above is CI 3.5 and Idle 3.4. subprocess and pyflakes work fine on linux. We 
are trying to add a feature to Idle to do above on file in editor, and are 
stuck here. The actual provisional code is
+            proc = Popen(args, stdout=PIPE, stderr=PIPE)
+            proc.wait()
+            output, error = map(lambda b:b.decode('utf-8'), proc.communicate())
where args is  list, which shows the same hang forever behavior.

----------
nosy: +steve.dower, terry.reedy, zach.ware
resolution: rejected -> 
status: closed -> open
versions: +Python 3.4, Python 3.5 -Python 2.5, Python 2.6, Python 3.1, Python 
3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8631>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to