{"action":"created","issue":{"url":"https://api.github.com/repos/boto/boto/issues/3311","labels_url":"https://api.github.com/repos/boto/boto/issues/3311/labels{/name}","comments_url":"https://api.github.com/repos/boto/boto/issues/3311/comments","events_url":"https://api.github.com/repos/boto/boto/issues/3311/events","html_url":"https://github.com/boto/boto/issues/3311","id":102086942,"number":3311,"title":"s3.Key.read always reads the entire file","user":{"login":"pylior","id":2955289,"avatar_url":"https://avatars.githubusercontent.com/u/2955289?v=3","gravatar_id":"","url":"https://api.github.com/users/pylior","html_url":"https://github.com/pylior","followers_url":"https://api.github.com/users/pylior/followers","following_url":"https://api.github.com/users/pylior/following{/other_user}","gists_url":"https://api.github.com/users/pylior/gists{/gist_id}","starred_url":"https://api.github.com/users/pylior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pylior/subscriptions","organizations_url":"https://api.github.com/users/pylior/orgs","repos_url":"https://api.github.com/users/pylior/repos","events_url":"https://api.github.com/users/pylior/events{/privacy}","received_events_url":"https://api.github.com/users/pylior/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-20T08:15:51Z","updated_at":"2015-08-21T22:44:34Z","closed_at":null,"body":"Hello,\r\nSince Key.read always opens the file and closes it afterwards it's behavior is not similar to a normal file.read\r\n\r\nWhen calling read twice in a row on a normal file object the first will return the entire file. And the second will return an empty string.\r\n\r\nKey's read method always reads the entire file. This interferes with some libraries which depend on the empty string behavior. e.g. messytables. I started researching it when I tried to guess types of a small (10 lines) CSV file using messytables. Since read always returned the entire file and messytables aspired to fill a 1000 line buffer, the file was read 100 times which cause the headers to be included in the data and thus every column was detected as a string.\r\n\r\n\r\nAnother issure,\r\nIt seems impossible to use Key.open_read as a fd to gzip.GzipFile because it does not support seek/tell. Are there any workarounds to it? Except wrapping the Key object in a buffered object which allows seek/tell?"},"comment":{"url":"https://api.github.com/repos/boto/boto/issues/comments/133581684","html_url":"https://github.com/boto/boto/issues/3311#issuecomment-133581684","issue_url":"https://api.github.com/repos/boto/boto/issues/3311","id":133581684,"user":{"login":"pylior","id":2955289,"avatar_url":"https://avatars.githubusercontent.com/u/2955289?v=3","gravatar_id":"","url":"https://api.github.com/users/pylior","html_url":"https://github.com/pylior","followers_url":"https://api.github.com/users/pylior/followers","following_url":"https://api.github.com/users/pylior/following{/other_user}","gists_url":"https://api.github.com/users/pylior/gists{/gist_id}","starred_url":"https://api.github.com/users/pylior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pylior/subscriptions","organizations_url":"https://api.github.com/users/pylior/orgs","repos_url":"https://api.github.com/users/pylior/repos","events_url":"https://api.github.com/users/pylior/events{/privacy}","received_events_url":"https://api.github.com/users/pylior/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T22:44:34Z","updated_at":"2015-08-21T22:44:34Z","body":"I shall\n\nOn Sat, Aug 22, 2015 at 1:43 AM Steven Richards <notifications@github.com>\nwrote:\n\n> @pylior <https://github.com/pylior> I don't see anything attached to the\n> issue since you replied via email, can you link the files directly to the\n> github issue?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/boto/boto/issues/3311#issuecomment-133581570>.\n>\n"}}