From: Klokan P. P. <kl...@kl...> - 2009-09-26 11:37:34
|
Hello, first: thank you a lot for the great py2exe application. It is done very well and I am using it in several python projects. I have found a bug, which I would like to report to developers: It seems that the "unbuffered":True option is not really behaving the same like "python -u". I have prepared a test of that functionality - with an example script sum_primes.py from the module "pp" (http://parallelpython.com/). Parallel python starts more processes of python via subprocess.popen, and those processes talk to each other via pipes. Unbuffered I/O is necessary. The code and data are transcoded by the module "pickle". The complete source code of the test with correct setup.py and documentation in the README file is available here: http://github.com/klokan/py2exepp/tree/unbuffered You can directly download it as zip: http://github.com/klokan/py2exepp/zipball/unbuffered When you download the code and run "python setup.py" it produces correct dist/sum_primes.exe. It should run without problems, because popen starts bundled python interpreter as: "python.exe -u ppworker.py". By uncommenting lines 131-133 in pp/__init__.py you can let the subprocess start with "python ppworker.py" (without "-u"), or as "ppworker.exe" or start the original executable again so "sum_primes.exe". Code is here: http://github.com/klokan/py2exepp/blob/unbuffered/pp/__init__.py#L132 I think that all of those fail with "EOFError", because py2exe does not correctly implement "unbuffered" I/O - even thought this option is present in the setup.py. I will be very glad to assist with debugging of this functionality to anybody who is developing py2exe... Any comments are welcomed. Best regards, Klokan Petr Pridal -- http://blog.klokan.cz/ http://www.maptiler.org/ http://www.oldmapsonline.org/ |