#8998: stdin closed by become_daemon()
----------------------------------+-----------------------------------------
 Reporter:  [EMAIL PROTECTED]  |       Owner:  nobody    
   Status:  new                   |   Milestone:            
Component:  Uncategorized         |     Version:  1.0       
 Keywords:                        |       Stage:  Unreviewed
Has_patch:  0                     |  
----------------------------------+-----------------------------------------
 In ./django/utils/daemonize.py the posix become_daemon() function contains
 this code:
         si = open('/dev/null', 'r')
         so = open(out_log, 'a+', 0)
         se = open(err_log, 'a+', 0)
         os.dup2(si.fileno(), sys.stdin.fileno())
         os.dup2(so.fileno(), sys.stdout.fileno())
         os.dup2(se.fileno(), sys.stderr.fileno())
         # Set custom file descriptors so that they get proper buffering.
         sys.stdout, sys.stderr = so, se

 When si passes out of scope the desctructor ends up closing FD 0
 (sys.stdin).  If anything tries to read stdin it will get the contents of
 the next open()ed file.

 sys.stdin = si should be sufficient to keep it in scope.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8998>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to