{"action":"created","issue":{"url":"https://api.github.com/repos/eleme/thriftpy/issues/170","labels_url":"https://api.github.com/repos/eleme/thriftpy/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/eleme/thriftpy/issues/170/comments","events_url":"https://api.github.com/repos/eleme/thriftpy/issues/170/events","html_url":"https://github.com/eleme/thriftpy/issues/170","id":118513084,"number":170,"title":"Java ProcessBuilder.inheritIO not working with thriftpy","user":{"login":"marekjagielski","id":5246566,"avatar_url":"https://avatars.githubusercontent.com/u/5246566?v=3","gravatar_id":"","url":"https://api.github.com/users/marekjagielski","html_url":"https://github.com/marekjagielski","followers_url":"https://api.github.com/users/marekjagielski/followers","following_url":"https://api.github.com/users/marekjagielski/following{/other_user}","gists_url":"https://api.github.com/users/marekjagielski/gists{/gist_id}","starred_url":"https://api.github.com/users/marekjagielski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marekjagielski/subscriptions","organizations_url":"https://api.github.com/users/marekjagielski/orgs","repos_url":"https://api.github.com/users/marekjagielski/repos","events_url":"https://api.github.com/users/marekjagielski/events{/privacy}","received_events_url":"https://api.github.com/users/marekjagielski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-24T01:35:59Z","updated_at":"2016-01-21T09:53:15Z","closed_at":null,"body":"I posted originaly description of my problem here: http://stackoverflow.com/questions/33769080/processbuilder-inheritio-not-working-when-python-with-thread-setdaemon\r\n\r\nI am running python application from Java.  I established two-way communication between Java and Python.\r\nI wrote in my Java code pb.inheritIO() to redirect python prints to standard output. And redirection is not working.\r\n\r\nI made a workaround by overloading handle method of TThreadedServer. \r\nIn while loop I forced flushing streams:\r\n\r\n        while True:\r\n            self.processor.process(iprot, oprot)\r\n            sys.stdout.flush()\r\n            sys.stderr.flush()\r\n\r\nCould it be a valid solution to be integrated into thriftpy?"},"comment":{"url":"https://api.github.com/repos/eleme/thriftpy/issues/comments/173520256","html_url":"https://github.com/eleme/thriftpy/issues/170#issuecomment-173520256","issue_url":"https://api.github.com/repos/eleme/thriftpy/issues/170","id":173520256,"user":{"login":"lxyu","id":678685,"avatar_url":"https://avatars.githubusercontent.com/u/678685?v=3","gravatar_id":"","url":"https://api.github.com/users/lxyu","html_url":"https://github.com/lxyu","followers_url":"https://api.github.com/users/lxyu/followers","following_url":"https://api.github.com/users/lxyu/following{/other_user}","gists_url":"https://api.github.com/users/lxyu/gists{/gist_id}","starred_url":"https://api.github.com/users/lxyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxyu/subscriptions","organizations_url":"https://api.github.com/users/lxyu/orgs","repos_url":"https://api.github.com/users/lxyu/repos","events_url":"https://api.github.com/users/lxyu/events{/privacy}","received_events_url":"https://api.github.com/users/lxyu/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T09:53:15Z","updated_at":"2016-01-21T09:53:15Z","body":"I'm not very clear about the problems, it seems you're trying to capture the stdout output from python server and redirect them to java, so I'll try to discuss this problem here:\r\n\r\n1. what method do you use to print to console, the logger with logging config or the raw print function?\r\n2. If you run the python server daemon directly from console, is there any output?\r\n\r\nI guess it may be related to python deamonize and stdout issue, you may check these links first: \r\nhttps://stackoverflow.com/questions/13180720/maintaining-logging-and-or-stdout-stderr-in-python-daemon\r\nhttp://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/"}}