GitHub PullRequestReviewCommentEvent at 2014-06-02 09:00:31
Repository: cartopy
Actor: pelson
Payload: {"comment":{"url":"https://api.github.com/repos/SciTools/cartopy/pulls/comments/13275610","id":13275610,"diff_hunk":"@@ -176,13 +177,15 @@ def _image_url(self, tile):\n         return url\n \n     def get_image(self, tile):\n-        import cStringIO  # *much* faster than StringIO\n-        import urllib\n+        if six.PY3:\n+            from urllib.request import urlopen\n+        else:\n+            from urllib2 import urlopen\n \n         url = self._image_url(tile)\n \n-        fh = urllib.urlopen(url)\n-        im_data = cStringIO.StringIO(fh.read())\n+        fh = urlopen(url)\n+        im_data = six.BytesIO(fh.read())","path":"lib/cartopy/io/img_tiles.py","position":24,"original_position":24,"commit_id":"18b6b5a992c2b66cdd229c1647e148aac72fad8e","original_commit_id":"18b6b5a992c2b66cdd229c1647e148aac72fad8e","user":{"login":"pelson","id":810663,"avatar_url":"https://avatars.githubusercontent.com/u/810663?","gravatar_id":"a3a8307ffcd780e908d042bcc97cd2f8","url":"https://api.github.com/users/pelson","html_url":"https://github.com/pelson","followers_url":"https://api.github.com/users/pelson/followers","following_url":"https://api.github.com/users/pelson/following{/other_user}","gists_url":"https://api.github.com/users/pelson/gists{/gist_id}","starred_url":"https://api.github.com/users/pelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelson/subscriptions","organizations_url":"https://api.github.com/users/pelson/orgs","repos_url":"https://api.github.com/users/pelson/repos","events_url":"https://api.github.com/users/pelson/events{/privacy}","received_events_url":"https://api.github.com/users/pelson/received_events","type":"User","site_admin":false},"body":"In Python2, according to the documentation, it looks like this is using StringIO not, cStringIO. I'm curious as to whether this has a noticeable impact on performance.","created_at":"2014-06-02T09:00:31Z","updated_at":"2014-06-02T09:00:31Z","html_url":"https://github.com/SciTools/cartopy/pull/422#discussion_r13275610","pull_request_url":"https://api.github.com/repos/SciTools/cartopy/pulls/422","_links":{"self":{"href":"https://api.github.com/repos/SciTools/cartopy/pulls/comments/13275610"},"html":{"href":"https://github.com/SciTools/cartopy/pull/422#discussion_r13275610"},"pull_request":{"href":"https://api.github.com/repos/SciTools/cartopy/pulls/422"}}}}