Python3 does not support unbuffered text I/O

Kikutake Ko kikutake at appi.t.u-tokyo.ac.jp
Fri May 6 12:49:45 UTC 2016


I'm trying to use DaemonRunner class with python3.
My python-daemon version is 2.1.1 obtained from pypi.

DaemonRunner.__init__ method raises an exception "ValueError: can't have 
unbuffered text I/O" in line 113 in daemon/runner.py.This exception is 
raised by "open" builtin function. This is the code:

         self.daemon_context.stderr = open(
                 app.stderr_path, 'w+t', buffering=0)

The problem is that buffering = 0 is allowed only in binary mode in 
python3. I think this is because of Unicode issues. A possible 
workaround is to use binary mode.

And there is a related topic in StackOverflow.

http://stackoverflow.com/questions/27506088/python-3-3-4-python-daemon-3k-how-to-use-runner

This SO question is for python-daemon-3K, not up-to-date forked 
python-daemon for python3.
The problems are completely same.
|
|Thanks.

Ko Kikutake



More information about the python-daemon-devel mailing list