              sys.stderr = open(err_log, 'a', 0)
          else:
              sys.stderr = NullDevice()
          if out_log:
              sys.stdout = open(out_log, 'a', 0)
          else:
              sys.stdout = NullDevice()
  
      class NullDevice:
          "A writeable object that writes to nowhere -- like /dev/null."
 
</s> remove             sys.stderr = open(err_log, 'a', 0)
 </s> add             sys.stderr = open(err_log, 'a', buffering) </s> remove         so = open(out_log, 'a+', 0)
        se = open(err_log, 'a+', 0)
 </s> add         so = open(out_log, 'a+', buffering)
        se = open(err_log, 'a+', buffering)
            sys.stdout = open(out_log, 'a', buffering)
              sys.stderr = open(err_log, 'a', 0)
          else:
              sys.stderr = NullDevice()
          if out_log:
            sys.stdout = open(out_log, 'a', buffering)
          else:
              sys.stdout = NullDevice()
  
      class NullDevice:
          "A writeable object that writes to nowhere -- like /dev/null."
keep keep keep keep replace keep keep keep keep keep
 Fixed #20815 -- Don't enforce unbuffered I/O on Python 3.

No test because this code is already deprecated (part of FastCGI support). 
django/utils/daemonize.py