py2exe does the same as python itself to implement unbuffered input and
output. Also, try setting PYTHONUNBUFFERED in the environment - this
should force Python itself to also set unbuffered output - it would be
interesting to see if that makes a difference.
Otherwise, you should be able to demonstrate unbuffered output isn't
working via a simple stand-alone program that doesn't use the subprocess
module - that would help narrow down the problem to something which can
be looked at fairly quickly.
On 26/09/2009 9:37 PM, Klokan Petr Přidal wrote:
> 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:
> You can directly download it as zip:
> 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
> Code is here:
> 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