{"action":"created","issue":{"url":"https://api.github.com/repos/kynan/nbstripout/issues/11","repository_url":"https://api.github.com/repos/kynan/nbstripout","labels_url":"https://api.github.com/repos/kynan/nbstripout/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/kynan/nbstripout/issues/11/comments","events_url":"https://api.github.com/repos/kynan/nbstripout/issues/11/events","html_url":"https://github.com/kynan/nbstripout/issues/11","id":132778977,"number":11,"title":"encoding issues","user":{"login":"geggo","id":968371,"avatar_url":"https://avatars.githubusercontent.com/u/968371?v=3","gravatar_id":"","url":"https://api.github.com/users/geggo","html_url":"https://github.com/geggo","followers_url":"https://api.github.com/users/geggo/followers","following_url":"https://api.github.com/users/geggo/following{/other_user}","gists_url":"https://api.github.com/users/geggo/gists{/gist_id}","starred_url":"https://api.github.com/users/geggo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geggo/subscriptions","organizations_url":"https://api.github.com/users/geggo/orgs","repos_url":"https://api.github.com/users/geggo/repos","events_url":"https://api.github.com/users/geggo/events{/privacy}","received_events_url":"https://api.github.com/users/geggo/received_events","type":"User","site_admin":false},"labels":[{"id":259647043,"url":"https://api.github.com/repos/kynan/nbstripout/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":{"login":"kynan","id":346079,"avatar_url":"https://avatars.githubusercontent.com/u/346079?v=3","gravatar_id":"","url":"https://api.github.com/users/kynan","html_url":"https://github.com/kynan","followers_url":"https://api.github.com/users/kynan/followers","following_url":"https://api.github.com/users/kynan/following{/other_user}","gists_url":"https://api.github.com/users/kynan/gists{/gist_id}","starred_url":"https://api.github.com/users/kynan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kynan/subscriptions","organizations_url":"https://api.github.com/users/kynan/orgs","repos_url":"https://api.github.com/users/kynan/repos","events_url":"https://api.github.com/users/kynan/events{/privacy}","received_events_url":"https://api.github.com/users/kynan/received_events","type":"User","site_admin":false},"assignees":[{"login":"kynan","id":346079,"avatar_url":"https://avatars.githubusercontent.com/u/346079?v=3","gravatar_id":"","url":"https://api.github.com/users/kynan","html_url":"https://github.com/kynan","followers_url":"https://api.github.com/users/kynan/followers","following_url":"https://api.github.com/users/kynan/following{/other_user}","gists_url":"https://api.github.com/users/kynan/gists{/gist_id}","starred_url":"https://api.github.com/users/kynan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kynan/subscriptions","organizations_url":"https://api.github.com/users/kynan/orgs","repos_url":"https://api.github.com/users/kynan/repos","events_url":"https://api.github.com/users/kynan/events{/privacy}","received_events_url":"https://api.github.com/users/kynan/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/kynan/nbstripout/milestones/4","html_url":"https://github.com/kynan/nbstripout/milestone/4","labels_url":"https://api.github.com/repos/kynan/nbstripout/milestones/4/labels","id":1584354,"number":4,"title":"0.2.3","description":"","creator":{"login":"kynan","id":346079,"avatar_url":"https://avatars.githubusercontent.com/u/346079?v=3","gravatar_id":"","url":"https://api.github.com/users/kynan","html_url":"https://github.com/kynan","followers_url":"https://api.github.com/users/kynan/followers","following_url":"https://api.github.com/users/kynan/following{/other_user}","gists_url":"https://api.github.com/users/kynan/gists{/gist_id}","starred_url":"https://api.github.com/users/kynan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kynan/subscriptions","organizations_url":"https://api.github.com/users/kynan/orgs","repos_url":"https://api.github.com/users/kynan/repos","events_url":"https://api.github.com/users/kynan/events{/privacy}","received_events_url":"https://api.github.com/users/kynan/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":2,"state":"closed","created_at":"2016-02-15T21:44:35Z","updated_at":"2016-02-15T21:52:26Z","due_on":"2016-02-15T00:00:00Z","closed_at":"2016-02-15T21:52:26Z"},"comments":9,"created_at":"2016-02-10T18:22:30Z","updated_at":"2016-12-15T23:02:36Z","closed_at":"2016-02-15T21:02:43Z","body":"Hi,\n\nWhen stripping a notebook that contains unicode I get an error if I use nbstripout as a filter, piping to a file, e.g.  `cat test.ipynb | nbstripout > out.ipynb`, git also fails\n\n```\nFile \"/Users/gregor/anaconda/lib/python2.7/site-packages/nbstripout-0.2.2-py2.7.egg/nbstripout.py\", line 176, in main\n    write(strip_output(read(sys.stdin, as_version=NO_CONVERT)), sys.stdout)\n  File \"/Users/gregor/anaconda/lib/python2.7/site-packages/nbformat/__init__.py\", line 169, in write\n    fp.write(s)\nUnicodeEncodeError: 'ascii' codec can't encode character u'\\xf6' in position 20464: ordinal not in range(128)\n```\n\nthen `sys.stdout.encoding` is `None` (which defaults to `'ascii'` codec)\n\nAs a workaround I found to modify the last few lines of nbstripout.py:\n\n```\n        import codecs\n        sys.stdout = codecs.getwriter('utf8')(sys.stdout)\n        write(strip_output(read(sys.stdin, as_version=NO_CONVERT)), sys.stdout)\n```\n\n(according to this stack overflow [entry](http://stackoverflow.com/questions/492483/setting-the-correct-encoding-when-piping-stdout-in-python), but I am not sure if this is really a correct solution )\nI am on os x, anaconda python 2.7 with nbformat 4.0.1\n\nGregor\n\nPS thanks for your work, I really like `nbstripout install`\n"},"comment":{"url":"https://api.github.com/repos/kynan/nbstripout/issues/comments/267470308","html_url":"https://github.com/kynan/nbstripout/issues/11#issuecomment-267470308","issue_url":"https://api.github.com/repos/kynan/nbstripout/issues/11","id":267470308,"user":{"login":"kynan","id":346079,"avatar_url":"https://avatars.githubusercontent.com/u/346079?v=3","gravatar_id":"","url":"https://api.github.com/users/kynan","html_url":"https://github.com/kynan","followers_url":"https://api.github.com/users/kynan/followers","following_url":"https://api.github.com/users/kynan/following{/other_user}","gists_url":"https://api.github.com/users/kynan/gists{/gist_id}","starred_url":"https://api.github.com/users/kynan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kynan/subscriptions","organizations_url":"https://api.github.com/users/kynan/orgs","repos_url":"https://api.github.com/users/kynan/repos","events_url":"https://api.github.com/users/kynan/events{/privacy}","received_events_url":"https://api.github.com/users/kynan/received_events","type":"User","site_admin":false},"created_at":"2016-12-15T23:02:36Z","updated_at":"2016-12-15T23:02:36Z","body":"@takluyver thanks for highlighting! I did read up on the topic after fixing this but failed to clarify."}}
{"actor":{"display_login":"kynan"}}