Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-08 Thread Chris Angelico
On Fri, Aug 8, 2014 at 5:17 PM, Rustom Mody wrote: >> But with Roy's suggestion, testing for the existence of os.fork is not >> sufficient, because it will exist even on platforms where fork doesn't >> exist. So testing that os.fork exists is not sufficient to tell whether or >> not you can actual

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-08 Thread Rustom Mody
On Friday, August 8, 2014 11:18:17 AM UTC+5:30, Steven D'Aprano wrote: > Rustom Mody wrote: > > On Thursday, August 7, 2014 10:26:56 PM UTC+5:30, Steven D'Aprano wrote: > >> Roy Smith wrote: > >> > Peter Otten wrote: > >> >> os.fork() > >> >> Fork a child process. > >> >> ... > >> >> Availabilit

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-07 Thread Steven D'Aprano
Rustom Mody wrote: > On Thursday, August 7, 2014 10:26:56 PM UTC+5:30, Steven D'Aprano wrote: >> Roy Smith wrote: > >> > Peter Otten wrote: >> >> os.fork() >> >> Fork a child process. >> >> ... >> >> Availability: Unix. >> >> """ >> >> You are using the wrong operating system ;) >> > To be hone

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-07 Thread Rustom Mody
On Friday, August 8, 2014 10:49:27 AM UTC+5:30, Rustom Mody wrote: > On Thursday, August 7, 2014 10:26:56 PM UTC+5:30, Steven D'Aprano wrote: > > Roy Smith wrote: > > > Peter Otten wrote: > > >> os.fork() > > >> Fork a child process. > > >> ... > > >> Availability: Unix. > > >> """ > > >> You ar

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-07 Thread Rustom Mody
On Thursday, August 7, 2014 10:26:56 PM UTC+5:30, Steven D'Aprano wrote: > Roy Smith wrote: > > Peter Otten wrote: > >> os.fork() > >> Fork a child process. > >> ... > >> Availability: Unix. > >> """ > >> You are using the wrong operating system ;) > > To be honest, this could be considered a bu

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-07 Thread Steven D'Aprano
Roy Smith wrote: > In article , > Peter Otten <__pete...@web.de> wrote: > >> os.fork() >> Fork a child process. >> ... >> Availability: Unix. >> """ >> >> You are using the wrong operating system ;) > > To be honest, this could be considered a buglet in the os module. It > really should raise

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-07 Thread Roy Smith
In article , Peter Otten <__pete...@web.de> wrote: > os.fork() > Fork a child process. > ... > Availability: Unix. > """ > > You are using the wrong operating system ;) To be honest, this could be considered a buglet in the os module. It really should raise: NotImplementedError("fork() is on

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-07 Thread Peter Otten
Satish ML wrote: > Hi, > > Code: > import os, time > def child(pipeout): > zzz = 0 > while True: > time.sleep(zzz) > msg = ('Spam %03d' % zzz).encode() > os.write(pipeout, msg) > zzz = (zzz+1) % 5 > def parent(): > pipein, pipeout = os.pipe() > if o