{"action":"closed","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/1407","repository_url":"https://api.github.com/repos/pytest-dev/pytest","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1407/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1407/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1407/events","html_url":"https://github.com/pytest-dev/pytest/issues/1407","id":135509197,"number":1407,"title":"capsys + sys.stdout.buffer => AttributeError","user":{"login":"asottile","id":1810591,"avatar_url":"https://avatars.githubusercontent.com/u/1810591?v=3","gravatar_id":"","url":"https://api.github.com/users/asottile","html_url":"https://github.com/asottile","followers_url":"https://api.github.com/users/asottile/followers","following_url":"https://api.github.com/users/asottile/following{/other_user}","gists_url":"https://api.github.com/users/asottile/gists{/gist_id}","starred_url":"https://api.github.com/users/asottile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asottile/subscriptions","organizations_url":"https://api.github.com/users/asottile/orgs","repos_url":"https://api.github.com/users/asottile/repos","events_url":"https://api.github.com/users/asottile/events{/privacy}","received_events_url":"https://api.github.com/users/asottile/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-02-22T18:59:55Z","updated_at":"2017-02-24T23:19:48Z","closed_at":"2017-02-24T23:19:48Z","body":"Applicable versions where sys.stdout.buffer should exist and be a bytestream:\n- python3.x\n\n``` python\nimport sys\n\n\ndef test(capsys):\n    sys.stdout.buffer.write(b'hi\\n')\n    assert capsys.readouterr()[0] == 'hi\\n'\n```\n\n```\n$ py.test test.py\n============================= test session starts ==============================\nplatform linux -- Python 3.4.3, pytest-2.8.7, py-1.4.31, pluggy-0.3.1\nrootdir: /home/asottile/workspace/cheetah_lint, inifile: \ncollected 1 items \n\ntest.py F\n\n=================================== FAILURES ===================================\n_____________________________________ test _____________________________________\n\ncapsys = <_pytest.capture.CaptureFixture object at 0x7f15ca2cd320>\n\n    def test(capsys):\n>       sys.stdout.buffer.write(b'hi\\n')\nE       AttributeError: '_io.StringIO' object has no attribute 'buffer'\n\ntest.py:5: AttributeError\n=========================== 1 failed in 0.01 seconds ===========================\n```\n"}}
{"actor":{"display_login":"nicoddemus"}}