{"action":"created","issue":{"url":"https://api.github.com/repos/NII-cloud-operation/Jupyter-LC_wrapper/issues/4","repository_url":"https://api.github.com/repos/NII-cloud-operation/Jupyter-LC_wrapper","labels_url":"https://api.github.com/repos/NII-cloud-operation/Jupyter-LC_wrapper/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/NII-cloud-operation/Jupyter-LC_wrapper/issues/4/comments","events_url":"https://api.github.com/repos/NII-cloud-operation/Jupyter-LC_wrapper/issues/4/events","html_url":"https://github.com/NII-cloud-operation/Jupyter-LC_wrapper/issues/4","id":231624616,"number":4,"title":"TypeError: write() argument must be str, not bytes","user":{"login":"yacchin1205","id":968739,"avatar_url":"https://avatars0.githubusercontent.com/u/968739?v=3","gravatar_id":"","url":"https://api.github.com/users/yacchin1205","html_url":"https://github.com/yacchin1205","followers_url":"https://api.github.com/users/yacchin1205/followers","following_url":"https://api.github.com/users/yacchin1205/following{/other_user}","gists_url":"https://api.github.com/users/yacchin1205/gists{/gist_id}","starred_url":"https://api.github.com/users/yacchin1205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yacchin1205/subscriptions","organizations_url":"https://api.github.com/users/yacchin1205/orgs","repos_url":"https://api.github.com/users/yacchin1205/repos","events_url":"https://api.github.com/users/yacchin1205/events{/privacy}","received_events_url":"https://api.github.com/users/yacchin1205/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-26T13:19:49Z","updated_at":"2017-05-26T15:52:58Z","closed_at":null,"body":"The exception `TypeError: write() argument must be str, not bytes` occurred on Python3.\r\n\r\nThe details are as follows...\r\n\r\n```\r\n[IPKernelApp] ERROR | a exception caught in execute_interactive\r\n[IPKernelApp] ERROR | Exception in message handler:\r\nTraceback (most recent call last):\r\n  File \"/opt/conda/lib/python3.5/site-packages/ipykernel/kernelbase.py\", line 235, in dispatch_shell\r\n    handler(stream, idents, msg)\r\n  File \"/opt/conda/lib/python3.5/site-packages/lc_wrapper.py\", line 575, in execute_request\r\n    super(PythonKernelBuffered, self).execute_request(stream, ident, parent)\r\n  File \"/opt/conda/lib/python3.5/site-packages/ipykernel/kernelbase.py\", line 399, in execute_request\r\n    user_expressions, allow_stdin)\r\n  File \"/opt/conda/lib/python3.5/site-packages/lc_wrapper.py\", line 601, in do_execute\r\n    timeout=None, output_hook=output_hook, stdin_hook=stdin_hook, reply_hook=reply_hook)\r\n  File \"/opt/conda/lib/python3.5/site-packages/lc_wrapper.py\", line 847, in execute_interactive\r\n    return reply_hook(msg_id, timeout=timeout)\r\n  File \"/opt/conda/lib/python3.5/site-packages/lc_wrapper.py\", line 534, in reply_hook_summarize\r\n    self.close_files()\r\n  File \"/opt/conda/lib/python3.5/site-packages/lc_wrapper.py\", line 399, in close_files\r\n    self.log_buff_flush()\r\n  File \"/opt/conda/lib/python3.5/site-packages/lc_wrapper.py\", line 332, in log_buff_flush\r\n    self.file_full_path = self.write_log_file(self.log_path, self.file_full_path, u''.join(self.summarize_log_buff))\r\n  File \"/opt/conda/lib/python3.5/site-packages/lc_wrapper.py\", line 117, in write_log_file\r\n    self.log_file_object.write(msg.encode('utf-8'))\r\nTypeError: write() argument must be str, not bytes\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/NII-cloud-operation/Jupyter-LC_wrapper/issues/comments/304318919","html_url":"https://github.com/NII-cloud-operation/Jupyter-LC_wrapper/issues/4#issuecomment-304318919","issue_url":"https://api.github.com/repos/NII-cloud-operation/Jupyter-LC_wrapper/issues/4","id":304318919,"user":{"login":"shingo78","id":10056150,"avatar_url":"https://avatars3.githubusercontent.com/u/10056150?v=3","gravatar_id":"","url":"https://api.github.com/users/shingo78","html_url":"https://github.com/shingo78","followers_url":"https://api.github.com/users/shingo78/followers","following_url":"https://api.github.com/users/shingo78/following{/other_user}","gists_url":"https://api.github.com/users/shingo78/gists{/gist_id}","starred_url":"https://api.github.com/users/shingo78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shingo78/subscriptions","organizations_url":"https://api.github.com/users/shingo78/orgs","repos_url":"https://api.github.com/users/shingo78/repos","events_url":"https://api.github.com/users/shingo78/events{/privacy}","received_events_url":"https://api.github.com/users/shingo78/received_events","type":"User","site_admin":false},"created_at":"2017-05-26T15:52:58Z","updated_at":"2017-05-26T15:52:58Z","body":"I think that the 2nd option is better because the log file is text file, not binary file.\r\n\r\nAnd, use `io.open` with `encoding` parameter, because in Python2 `open` doesn't accept encoding and raises a UnicodeEncodeError if unicode object includes non-ascii character.\r\n\r\n"}}
{"actor":{"display_login":"shingo78"}}