Actions
Bug #14990
closedgevent regression
% Done:
0%
Source:
other
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):
Description
command = '/bin/echo -n AB ; /bin/echo C', log_limit = 2 def sh(command, log_limit=1024): """ Run the shell command and return the output in ascii (stderr and stdout). If the command fails, raise an exception. The command and its output are logged, on success and on error. """ log.debug(":sh: " + command) proc = subprocess.Popen( args=command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, bufsize=1) lines = [] truncated = False > with proc.stdout: E AttributeError: __exit__ teuthology/misc.py:1305: AttributeError
Updated by Loïc Dachary about 8 years ago
- Project changed from Ceph to teuthology
Updated by Loïc Dachary about 8 years ago
Updated by Zack Cerza about 8 years ago
- Assignee changed from Loïc Dachary to Zack Cerza
I merged Loic's PR but I wanted to do things a bit differently so I'm following up with:
https://github.com/ceph/teuthology/pull/812
Here is a simple reproducer:
#!/usr/bin/env python import sys print "python version: ", sys.version.split()[0] import gevent print "gevent version: ", gevent.__version__ import gevent.monkey gevent.monkey.patch_all() import subprocess proc = subprocess.Popen( args="echo pass!", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, ) print "proc.stdout is a ", type(proc.stdout) with proc.stdout: print proc.stdout.read()
Example of happy output:
python version: 2.7.11 gevent version: 1.0.2 proc.stdout is a <type 'file'> pass!
Example of sad output:
python version: 2.7.11 gevent version: 1.2.0.dev0 proc.stdout is a <class 'gevent._fileobjectposix.FileObjectPosix'> Traceback (most recent call last): File "/tmp/gevent_test.py", line 18, in <module> with proc.stdout: AttributeError: __exit__
Updated by Zack Cerza about 8 years ago
- Status changed from Fix Under Review to Resolved
Actions