FakePopen does not work in Python 3.3+
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Python Fixtures |
High
|
Steve Kowalik | ||
Bug Description
While porting os-collect-config to Python 3, I came across this gem:
Traceback (most recent call last):
File "./os_collect_
calls = self._fake_
File "./os_collect_
self.
File "./os_collect_
collector_
File "./os_collect_
call_
File "./os_collect_
subprocess.
File "/usr/lib/
retcode = call(*popenargs, **kwargs)
File "/usr/lib/
with Popen(*popenargs, **kwargs) as p:
AttributeError: __exit__
This looks like Python 3 has changed the behavior of the subprocess module to make use of with, which requires __entry__() and __exit__() methods, which FakePopen does not support, hence the above traceback.
Related branches
- python-fixtures committers: Pending requested 2014-08-18
-
Diff: 48 lines (+17/-0)3 files modifiedNEWS (+6/-0)
lib/fixtures/_fixtures/popen.py (+6/-0)
lib/fixtures/tests/_fixtures/test_popen.py (+5/-0)
| Changed in python-fixtures: | |
| status: | New → Triaged |
| importance: | Undecided → High |
| status: | Triaged → Fix Released |
| assignee: | nobody → Steve Kowalik (stevenk) |
| milestone: | none → next |
