{"action":"created","issue":{"url":"https://api.github.com/repos/sympy/sympy/issues/9692","labels_url":"https://api.github.com/repos/sympy/sympy/issues/9692/labels{/name}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/9692/comments","events_url":"https://api.github.com/repos/sympy/sympy/issues/9692/events","html_url":"https://github.com/sympy/sympy/pull/9692","id":95838291,"number":9692,"title":"Use io.open to enable encoding kwarg in Py2 open()","user":{"login":"bjodah","id":485936,"avatar_url":"https://avatars.githubusercontent.com/u/485936?v=3","gravatar_id":"","url":"https://api.github.com/users/bjodah","html_url":"https://github.com/bjodah","followers_url":"https://api.github.com/users/bjodah/followers","following_url":"https://api.github.com/users/bjodah/following{/other_user}","gists_url":"https://api.github.com/users/bjodah/gists{/gist_id}","starred_url":"https://api.github.com/users/bjodah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjodah/subscriptions","organizations_url":"https://api.github.com/users/bjodah/orgs","repos_url":"https://api.github.com/users/bjodah/repos","events_url":"https://api.github.com/users/bjodah/events{/privacy}","received_events_url":"https://api.github.com/users/bjodah/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sympy/sympy/labels/Needs%20Decision","name":"Needs Decision","color":"f7c6c7"},{"url":"https://api.github.com/repos/sympy/sympy/labels/PR:%20sympy's%20turn","name":"PR: sympy's turn","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-18T16:28:18Z","updated_at":"2015-07-30T01:57:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sympy/sympy/pulls/9692","html_url":"https://github.com/sympy/sympy/pull/9692","diff_url":"https://github.com/sympy/sympy/pull/9692.diff","patch_url":"https://github.com/sympy/sympy/pull/9692.patch"},"body":"This was failing in my Python 2 jupyter notebook when using sympy git master:\r\n\r\n```\r\nfrom IPython.display import display, Latex\r\nfrom sympy.interactive import printing\r\nprinting.init_printing()\r\n\r\nfrom sympy import *\r\nparams = symbols('k l m'.split())\r\ndisplay(params)\r\n```\r\n\r\nencoding='utf-8' kwarg passed to open() was to blame. This commit should fix this bug and adds a test for `sympy.printing.preview` (maybe there was some other test(s) somewhere but I failed to find those).\r\n\r\nNote the use of `unicode_literals`. There maybe gotchas associated with this method if people try to pass str objects (in e.g. `packages` or `preamble` kwarg in preview) which will not mix with unicode.\r\n\r\nThe encoding kwarg was added by @dustyrockpyle in 723289c8 introduced in #9108 which fixed #9107\r\n"},"comment":{"url":"https://api.github.com/repos/sympy/sympy/issues/comments/126157578","html_url":"https://github.com/sympy/sympy/pull/9692#issuecomment-126157578","issue_url":"https://api.github.com/repos/sympy/sympy/issues/9692","id":126157578,"user":{"login":"asmeurer","id":71486,"avatar_url":"https://avatars.githubusercontent.com/u/71486?v=3","gravatar_id":"","url":"https://api.github.com/users/asmeurer","html_url":"https://github.com/asmeurer","followers_url":"https://api.github.com/users/asmeurer/followers","following_url":"https://api.github.com/users/asmeurer/following{/other_user}","gists_url":"https://api.github.com/users/asmeurer/gists{/gist_id}","starred_url":"https://api.github.com/users/asmeurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmeurer/subscriptions","organizations_url":"https://api.github.com/users/asmeurer/orgs","repos_url":"https://api.github.com/users/asmeurer/repos","events_url":"https://api.github.com/users/asmeurer/events{/privacy}","received_events_url":"https://api.github.com/users/asmeurer/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T01:57:32Z","updated_at":"2015-07-30T01:57:32Z","body":"-1 to using `unicode_literals`. "}}