Message170313
| Author |
sbt |
| Recipients |
palmer, sbt |
| Date |
2012年09月11日.15:17:10 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1347376631.75.0.88661504355.issue15914@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I get the same hang on Linux with Python 3.2.
For Windows the documentation does warn against starting a process as a side effect of importing a process. There is no explicit warning for Unix, but I would still consider it bad form to do such things as a side effect of importing a module.
It appears that it is the import of the hmac module inside deliver_challenge() that is hanging. I expect forking a process while an import is in progress may cause the import machinery (which I am not familiar with) to be in an inconsistent state. The import lock should have been reset automatically after the fork, but maybe that is not enough. Maybe the fact that the import is being done by a non-main thread is relevant.
I would suggest just rewriting the code as
create.py:
import multiprocessing
def main():
manager = multiprocessing.Manager()
namespace = manager.Namespace()
print("create.py complete")
if __name__ == '__main__':
main()
run.py:
import create
create.main()
print("run.py complete") |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年09月11日 15:17:11 | sbt | set | recipients:
+ sbt, palmer |
| 2012年09月11日 15:17:11 | sbt | set | messageid: <1347376631.75.0.88661504355.issue15914@psf.upfronthosting.co.za> |
| 2012年09月11日 15:17:11 | sbt | link | issue15914 messages |
| 2012年09月11日 15:17:10 | sbt | create |
|