NetBSD and threading errors

Felicia Neff fn at panix.com
Wed Nov 7 20:57:27 EST 2001


I am working with Python-2.1.1 on NetBSD-1.5.1.  I am building python with
the unproven-pthreads library (0.17 with and without NetBSD patches).  I
am encountering a number of problems with the program after it has compiled.

First, 'make test' fails on test-fork1 and then hangs after a few more
tests (although which test it stops at seems to vary).  Once it produced
the following error:
Unhandled exception in thread:
Traceback (most recent call last):
  File "./Lib/test/test_fork1.py", line 35, in f
    time.sleep(SHORTSLEEP)
AttributeError: 'None' object has no attribute 'sleep'
Unhandled exception in thread:
Traceback (most recent call last):
  File "./Lib/test/test_fork1.py", line 35, in f
    time.sleep(SHORTSLEEP)
AttributeError: 'None' object has no attribute 'sleep'
Unhandled exception in thread:
Traceback (most recent call last):
  File "./Lib/test/test_fork1.py", line 33, in f
    alive[id] = os.getpid()
AttributeError: 'None' object has no attribute 'getpid'
Unhandled exception in thread:
Traceback (most recent call last):
  File "./Lib/test/test_fork1.py", line 33, in f
    alive[id] = os.getpid()
AttributeError: 'None' object has no attribute 'getpid'

This python binary appears to do threading correctly, but fails on this
code:
#!/usr/local/bin/python2.1

import sys,os

pwdpipe = os.popen("/bin/pwd | /bin/cat", "r")
cwd = pwdpipe.readline()
print cwd  ## print adds a newline
if not cwd or cwd == "":
    sys.stderr.write("arrgh!\n")
    sys.exit(-1)
pwdpipe.close()

with this error:
arrgh!
cat: stdout: Bad file descriptor

It does not fail with the same version of python compiled without threads.
Any help would be greatly appreciated.  -- Felicia




More information about the Python-list mailing list