pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/51657: Python (2.7): interpreter hangs on exit after a call to subproccess.Popen()



>Number:         51657
>Category:       pkg
>Synopsis:       Python (2.7): interpreter hangs on exit after a call to subproccess.Popen()
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 26 14:10:00 +0000 2016
>Originator:     Oskar Skog
>Release:        6.1
>Organization:
>Environment:
$ uname -a
NetBSD .multi.fi 6.1 NetBSD 6.1 (GENERIC) i386
$ # VirtualBox x86-32, Python is 2.7.10 (2015-09-25)
$ # Not actually copy-pasted (the VM is on :1 while my browser is at :0)
>Description:
If subprocess.Popen() has ever been called, the interpreter will hang after the program has terminated (ie. at EOF, sys.exit() or quit()).

>How-To-Repeat:
#!/usr/pkg/bin/python
import subprocess
subprocess.Popen(['true'])
print('Program finished.')
# sys.exit(0) # also hangs
# quit() # also hangs
# Hangs at EOF
>Fix:
Using os._exit() which will bypass all the Python code and immediately exit the process. But this has the disadvantage that really weird things can happen if you try to pipe the script into something else. (Buffering perhaps?)


Home | Main Index | Thread Index | Old Index