{"action":"created","issue":{"url":"https://api.github.com/repos/gbeced/pyalgotrade/issues/45","labels_url":"https://api.github.com/repos/gbeced/pyalgotrade/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/gbeced/pyalgotrade/issues/45/comments","events_url":"https://api.github.com/repos/gbeced/pyalgotrade/issues/45/events","html_url":"https://github.com/gbeced/pyalgotrade/issues/45","id":60207376,"number":45,"title":"Python 2 to 3 Errors with Proposed Fixes (Getting Started) ","user":{"login":"drshrey","id":3188413,"avatar_url":"https://avatars.githubusercontent.com/u/3188413?v=3","gravatar_id":"","url":"https://api.github.com/users/drshrey","html_url":"https://github.com/drshrey","followers_url":"https://api.github.com/users/drshrey/followers","following_url":"https://api.github.com/users/drshrey/following{/other_user}","gists_url":"https://api.github.com/users/drshrey/gists{/gist_id}","starred_url":"https://api.github.com/users/drshrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drshrey/subscriptions","organizations_url":"https://api.github.com/users/drshrey/orgs","repos_url":"https://api.github.com/users/drshrey/repos","events_url":"https://api.github.com/users/drshrey/events{/privacy}","received_events_url":"https://api.github.com/users/drshrey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-07T14:03:54Z","updated_at":"2015-03-07T14:04:23Z","closed_at":null,"body":"Just did the getting started tutorial, and here are the errors that I got because of using Python 3. Unless I'm using the 2to3 tool wrong, there may be a few syntactic issues in the code (for Python 3 atleast).\r\ntools/yahoofinance.py: \r\n\r\n**Line 21:**\r\nCurrent: ```import urllib2```\r\nError: urllib2 module cannot be found\r\nReason: Since I'm using Python 3, urllib2 is no apart of urllib, and urllib is split up into different modules, specifically urllib.request and urllib.errors.\r\nMy change: ```import urllib.request as urllib2```\r\n\r\n**Line 130:**\r\nCurrent:```except Exception, e```\r\nError: invalid syntax\r\nReason: Python 3 semantics\r\nMy change: ```except Exception as e```\r\n\r\n**Line 48:**\r\nCurrent: ```while not buff[0].isalnum()```\r\nError: 'int' object does not have attribute isalnum()\r\nReason: isalnum() is only applicable to strings.\r\nMy change: ```while not str(buff[0]).isalbum()```\r\n\r\n**Line 67:** \r\nCurrent: ```f.write(bars)```\r\nError: TypeError: must be str, not bytes\r\nReason: See error\r\nMy change: ```f.write(str(bars))```\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/gbeced/pyalgotrade/issues/comments/77690459","html_url":"https://github.com/gbeced/pyalgotrade/issues/45#issuecomment-77690459","issue_url":"https://api.github.com/repos/gbeced/pyalgotrade/issues/45","id":77690459,"user":{"login":"drshrey","id":3188413,"avatar_url":"https://avatars.githubusercontent.com/u/3188413?v=3","gravatar_id":"","url":"https://api.github.com/users/drshrey","html_url":"https://github.com/drshrey","followers_url":"https://api.github.com/users/drshrey/followers","following_url":"https://api.github.com/users/drshrey/following{/other_user}","gists_url":"https://api.github.com/users/drshrey/gists{/gist_id}","starred_url":"https://api.github.com/users/drshrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drshrey/subscriptions","organizations_url":"https://api.github.com/users/drshrey/orgs","repos_url":"https://api.github.com/users/drshrey/repos","events_url":"https://api.github.com/users/drshrey/events{/privacy}","received_events_url":"https://api.github.com/users/drshrey/received_events","type":"User","site_admin":false},"created_at":"2015-03-07T14:04:23Z","updated_at":"2015-03-07T14:04:23Z","body":"It compiles after this error and outputs the correct csv file, just to confirm. "}}