{"action":"created","issue":{"url":"https://api.github.com/repos/dcos/dcos-cli/issues/621","repository_url":"https://api.github.com/repos/dcos/dcos-cli","labels_url":"https://api.github.com/repos/dcos/dcos-cli/issues/621/labels{/name}","comments_url":"https://api.github.com/repos/dcos/dcos-cli/issues/621/comments","events_url":"https://api.github.com/repos/dcos/dcos-cli/issues/621/events","html_url":"https://github.com/dcos/dcos-cli/issues/621","id":156307834,"number":621,"title":"dcos task log does not handle unicode","user":{"login":"jtwarren","id":1282605,"avatar_url":"https://avatars.githubusercontent.com/u/1282605?v=3","gravatar_id":"","url":"https://api.github.com/users/jtwarren","html_url":"https://github.com/jtwarren","followers_url":"https://api.github.com/users/jtwarren/followers","following_url":"https://api.github.com/users/jtwarren/following{/other_user}","gists_url":"https://api.github.com/users/jtwarren/gists{/gist_id}","starred_url":"https://api.github.com/users/jtwarren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtwarren/subscriptions","organizations_url":"https://api.github.com/users/jtwarren/orgs","repos_url":"https://api.github.com/users/jtwarren/repos","events_url":"https://api.github.com/users/jtwarren/events{/privacy}","received_events_url":"https://api.github.com/users/jtwarren/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jsancio","id":794394,"avatar_url":"https://avatars.githubusercontent.com/u/794394?v=3","gravatar_id":"","url":"https://api.github.com/users/jsancio","html_url":"https://github.com/jsancio","followers_url":"https://api.github.com/users/jsancio/followers","following_url":"https://api.github.com/users/jsancio/following{/other_user}","gists_url":"https://api.github.com/users/jsancio/gists{/gist_id}","starred_url":"https://api.github.com/users/jsancio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsancio/subscriptions","organizations_url":"https://api.github.com/users/jsancio/orgs","repos_url":"https://api.github.com/users/jsancio/repos","events_url":"https://api.github.com/users/jsancio/events{/privacy}","received_events_url":"https://api.github.com/users/jsancio/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-05-23T16:03:52Z","updated_at":"2016-05-23T22:10:33Z","closed_at":null,"body":"The emitter is not handling unicode and unfortunately my logs contain unicode characters that are non-trivial to remove.  \r\n\r\nhttps://github.com/dcos/dcos-cli/blob/master/dcos/emitting.py#L163\r\n\r\n```python\r\n>>> text = u\"dcos\"\r\n>>> str(text)\r\n'dcos'\r\n>>> text = u\"dcõs\"\r\n>>> str(text)\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\nUnicodeEncodeError: 'ascii' codec can't encode character u'\\xf5' in position 2: ordinal not in range(128)\r\n```\r\n\r\n### What version of the DCOS CLI are you using (`dcos --version`)?\r\ndcos version 0.4.4\r\n\r\n### What version of DCOS are you using?\r\nN/A\r\n\r\n### What operating system and version are you using?\r\nOSX 10.11.3\r\n\r\n### What did you do?\r\nIf possible please provide a recipe for reproducing.\r\n`dcos task log --follow`\r\n\r\n### What did you expect to see?\r\nValid log output\r\n\r\n### What did you see instead?\r\n```\r\nTraceback (most recent call last):\r\n  File \"/Users/jtwarren/Wellframe/dcos/lib/python2.7/site-packages/dcoscli/subcommand.py\", line 96, in run_and_capture\r\n    exit_code = m.main([self._command] + self._args)\r\n  File \"/Users/jtwarren/Wellframe/dcos/lib/python2.7/site-packages/dcoscli/task/main.py\", line 17, in main\r\n    return _main(argv)\r\n  File \"/Users/jtwarren/Wellframe/dcos/lib/python2.7/site-packages/dcoscli/util.py\", line 21, in wrapper\r\n    result = func(*args, **kwargs)\r\n  File \"/Users/jtwarren/Wellframe/dcos/lib/python2.7/site-packages/dcoscli/task/main.py\", line 30, in _main\r\n    return cmds.execute(_cmds(), args)\r\n  File \"/Users/jtwarren/Wellframe/dcos/lib/python2.7/site-packages/dcos/cmds.py\", line 43, in execute\r\n    return function(*params)\r\n  File \"/Users/jtwarren/Wellframe/dcos/lib/python2.7/site-packages/dcoscli/task/main.py\", line 157, in _log\r\n    log.log_files(mesos_files, follow, lines)\r\n  File \"/Users/jtwarren/Wellframe/dcos/lib/python2.7/site-packages/dcoscli/log.py\", line 43, in log_files\r\n    mesos_files)\r\n  File \"/Users/jtwarren/Wellframe/dcos/lib/python2.7/site-packages/dcoscli/log.py\", line 93, in _stream_files\r\n    lines)\r\n  File \"/Users/jtwarren/Wellframe/dcos/lib/python2.7/site-packages/dcoscli/log.py\", line 118, in _output\r\n    emitter.publish(line)\r\n  File \"/Users/jtwarren/Wellframe/dcos/lib/python2.7/site-packages/dcos/emitting.py\", line 57, in publish\r\n    self._handler(event)\r\n  File \"/Users/jtwarren/Wellframe/dcos/lib/python2.7/site-packages/dcos/emitting.py\", line 74, in print_handler\r\n    _page(event, pager_command)\r\n  File \"/Users/jtwarren/Wellframe/dcos/lib/python2.7/site-packages/dcos/emitting.py\", line 163, in _page\r\n    output = str(output)\r\nUnicodeEncodeError: 'ascii' codec can't encode character u'\\u2019' in position 536: ordinal not in range(128)\r\n```"},"comment":{"url":"https://api.github.com/repos/dcos/dcos-cli/issues/comments/221111316","html_url":"https://github.com/dcos/dcos-cli/issues/621#issuecomment-221111316","issue_url":"https://api.github.com/repos/dcos/dcos-cli/issues/621","id":221111316,"user":{"login":"jsancio","id":794394,"avatar_url":"https://avatars.githubusercontent.com/u/794394?v=3","gravatar_id":"","url":"https://api.github.com/users/jsancio","html_url":"https://github.com/jsancio","followers_url":"https://api.github.com/users/jsancio/followers","following_url":"https://api.github.com/users/jsancio/following{/other_user}","gists_url":"https://api.github.com/users/jsancio/gists{/gist_id}","starred_url":"https://api.github.com/users/jsancio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsancio/subscriptions","organizations_url":"https://api.github.com/users/jsancio/orgs","repos_url":"https://api.github.com/users/jsancio/repos","events_url":"https://api.github.com/users/jsancio/events{/privacy}","received_events_url":"https://api.github.com/users/jsancio/received_events","type":"User","site_admin":false},"created_at":"2016-05-23T22:10:33Z","updated_at":"2016-05-23T22:10:33Z","body":"Thanks. Looking into it."}}
{"actor":{"display_login":"jsancio"}}