Hi, be aware that I deliberately turn off the ability of Python to
read those environment variables. Specifically with this line

Py_IgnoreEnvironmentFlag = 1;

on line 263 of Win32GUI.c. You can comment out that code and then the
environment variables will affect behavior...but then you don't have a
"standalone" executable. I'll have to take a closer look at what
PYTHONIOENCODING does and see if there is some way to "burn" that in
to the executable in some fashion. In the meantime, you have a
workaround if you can stomach it. :-)

Anthony

On Fri, Apr 1, 2011 at 9:18 AM, Daniel Goertzen
<[email protected]> wrote:
> On Windows, Python 3 will crash if it is launched by a non-console
> application.  One example of this is apache/mod_wsgi under windows.  The
> work around is to set the environmental variable PYTHONIOENCODING before
> invoking Python.  This is all described in detail
> here: http://bugs.python.org/issue6501
>
> I am encountering this same problem when I run my Python 3 program as a
> subprocess under Erlang.  The PYTHONIOENCODING  workaround works when I run
> my program using pythonw.exe, but it does *not* work on the cx-freeze
> version.
> I skimmed Win32GUI.c and it looks straightforward; I don't understand why
> the PYTHONIOENCODING workaround fails for cx-freeze.  Does anybody have
> insights on this?
> I can easily recompile cx-freeze if anyone has code changes for me to try.
> Thanks,
> Dan.
> ------------------------------------------------------------------------------
> Create and publish websites with WebMatrix
> Use the most popular FREE web apps or write code yourself;
> WebMatrix provides all the features you need to develop and
> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
>
> _______________________________________________
> cx-freeze-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>
>

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
cx-freeze-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to