[Python-bugs-list] [ python-Bugs-426960 ] fork problem with Python-2.1

noreply@sourceforge.net noreply@sourceforge.net
Wed, 30 May 2001 01:06:19 -0700


Bugs item #426960, was updated on 2001-05-24 09:00
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=426960&group_id=5470

Category: Extension Modules
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Armin Steinhoff (arminsteinhoff)
Assigned to: Nobody/Anonymous (nobody)
Summary: fork problem with Python-2.1

Initial Comment:

I have a strange problem with Python2.1 running QNX6.
The test script test_fork1.py returns with following result:

# python -t test_fork1.py
/* sys.path include in script ... */
['', '/usr/local/lib/python2.1', '/usr/local/lib/python2.1/Lib/lib-tk',
'/usr/local/lib/python2.1/lib/python2.1', '/usr/local/
lib/python2.1/lib/python2.1/plat-qnx6',
'/usr/local/lib/python2.1/lib/python2.1/lib-tk',
'/usr/local/lib/python2.1/lib/python2 .1/lib-dynload']
Traceback (most recent call last):
  File "test_fork1.py", line 76, in ?
    main()
  File "test_fork1.py", line 55, in main
    cpid = os.fork()
OSError: [Errno 89] Function not implemented

----------------------------------------------------------------------
That's very strange ... because it works in the interactive mode =:-(
----------------------------------------------------------------------

# python
Python 2.1 (#16, May 11 2001, 18:37:57)
[GCC 2.95.2 19991024 (release)] on qnx6
Type "copyright", "credits" or "license" for more information.
>>> import sys, os
>>>sys.path
['', '/usr/local/lib/python2.1', '/usr/local/lib/python2.1/Lib/lib-tk',
'/usr/local/lib/python2.1/lib/python2.1',
'/usr/local/lib/python2.1/lib/python2.1/plat-qnx6',
'/usr/local/lib/python2.1/lib/python2.1/lib-tk',
'/usr/local/lib/python2.1/lib/python2 .1/lib-dynload']
>>>
>>> os.fork
<built-in function fork>
>>> os.fork()
6512990

Any ideas where to look?

Armin



----------------------------------------------------------------------

Comment By: Armin Steinhoff (arminsteinhoff)
Date: 2001-05-30 01:06

Message:
Logged In: YES 
user_id=64602


Hello Jeremy,

here are the reponses to os.name and import test.test_fork1:

# python
Python 2.1 (#16, May 11 2001, 18:37:57)
[GCC 2.95.2 19991024 (release)] on qnx6
Type "copyright", "credits" or "license" for more information.
>>> import os
>>> os.name
'posix'
>>> import test.test_fork1
['', '/root/Python-2.1/Lib', '/root/Python-2.1/Lib/Lib/lib-tk', '/root/Python-2.1/Lib/lib/python2.1', 
'/root/Python-2.1/Lib/lib/python2.1/plat-qnx6', '/root/Python-2.1/Lib/lib/python2.1/lib-tk', 
'/root/Python-2.1/Lib/lib/python2.1/lib-dynload']
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/root/Python-2.1/Lib/test/test_fork1.py", line 76, in ?
main()
File "/root/Python-2.1/Lib/test/test_fork1.py", line 55, in main
cpid = os.fork()
OSError: [Errno 89] Function not implemented
>>>

But 'fork' is of course implemented ...

Armin


----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2001-05-29 14:55

Message:
Logged In: YES 
user_id=31392

test_fork1 tests the behavior of threads across a fork (why
this is important is not entirely clear to me).  Perhaps the
problem you see is that fork() behaves differently in the
presence of threads.

Did you try this?
>>> import test.test_fork1

Is os.name == "posix" on your system?  Or does fork() come
from somewhere other than the posix module?


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=426960&group_id=5470