{"action":"created","issue":{"url":"https://api.github.com/repos/testing-cabal/mock/issues/291","labels_url":"https://api.github.com/repos/testing-cabal/mock/issues/291/labels{/name}","comments_url":"https://api.github.com/repos/testing-cabal/mock/issues/291/comments","events_url":"https://api.github.com/repos/testing-cabal/mock/issues/291/events","html_url":"https://github.com/testing-cabal/mock/issues/291","id":96081146,"number":291,"title":"mock_open().readlines() doesn't seem to work in 1.2.0","user":{"login":"ralsina","id":1579,"avatar_url":"https://avatars.githubusercontent.com/u/1579?v=3","gravatar_id":"","url":"https://api.github.com/users/ralsina","html_url":"https://github.com/ralsina","followers_url":"https://api.github.com/users/ralsina/followers","following_url":"https://api.github.com/users/ralsina/following{/other_user}","gists_url":"https://api.github.com/users/ralsina/gists{/gist_id}","starred_url":"https://api.github.com/users/ralsina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralsina/subscriptions","organizations_url":"https://api.github.com/users/ralsina/orgs","repos_url":"https://api.github.com/users/ralsina/repos","events_url":"https://api.github.com/users/ralsina/events{/privacy}","received_events_url":"https://api.github.com/users/ralsina/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-20T14:48:46Z","updated_at":"2015-07-21T16:27:47Z","closed_at":null,"body":"I have a test that was working in 1.1.4 where this mock is created:\r\n\r\n```\r\n        file_metadata = \".. slug: write-tests-now\\n\"\\\r\n                        \".. date: 2012/09/15 19:52:05\\n\"\\\r\n                        \".. tags:\\n\"\\\r\n                        \".. link:\\n\"\\\r\n                        \".. description:\\n\"\r\n\r\n        opener_mock = mock.mock_open(read_data=file_metadata)\r\n        opener_mock.return_value.readlines.return_value = file_metadata\r\n\r\n        with mock.patch('nikola.post.io.open', opener_mock, create=True):\r\n            meta, nsm = get_meta(post, 'file_with_metadata')\r\n```\r\n\r\nThe actual implementation of get_meta is uninteresting, here's what I see in pdb here:\r\n\r\n```\r\n-> meta_data = [x.strip() for x in meta_file.readlines()]\r\n(Pdb) meta_file.readlines()\r\nu'.. title: Nikola needs more tests!\\n.. date: 2012/09/15 19:52:05\\n.. tags:\\n.. link:\\n.. description:\\n\\nPost content\\n'\r\n(Pdb) meta_file.seek(0)\r\n<MagicMock name='open().seek()' id='140399406068560'>\r\n(Pdb) meta_file.read()\r\n'.. title: Nikola needs more tests!\\n.. date: 2012/09/15 19:52:05\\n.. tags:\\n.. link:\\n.. description:\\n\\nPost content\\n'\r\n```\r\n\r\nSo ... it seems readlines() does the same thing as read() and doesn't split in lines?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/testing-cabal/mock/issues/comments/123393069","html_url":"https://github.com/testing-cabal/mock/issues/291#issuecomment-123393069","issue_url":"https://api.github.com/repos/testing-cabal/mock/issues/291","id":123393069,"user":{"login":"rbtcollins","id":499678,"avatar_url":"https://avatars.githubusercontent.com/u/499678?v=3","gravatar_id":"","url":"https://api.github.com/users/rbtcollins","html_url":"https://github.com/rbtcollins","followers_url":"https://api.github.com/users/rbtcollins/followers","following_url":"https://api.github.com/users/rbtcollins/following{/other_user}","gists_url":"https://api.github.com/users/rbtcollins/gists{/gist_id}","starred_url":"https://api.github.com/users/rbtcollins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbtcollins/subscriptions","organizations_url":"https://api.github.com/users/rbtcollins/orgs","repos_url":"https://api.github.com/users/rbtcollins/repos","events_url":"https://api.github.com/users/rbtcollins/events{/privacy}","received_events_url":"https://api.github.com/users/rbtcollins/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T16:27:47Z","updated_at":"2015-07-21T16:27:47Z","body":"mock_open has the same code as 1.1.0 through 1.1.3, but not 1.1.4 (where we rolled a regression back from 1.1.4 in 1.2.0)\r\n\r\nPerhaps you could test this against Python 3.5 alpha4 ?"}}