Python 3.5.2 has an issue, please replace with 3.5.3
Closed, ResolvedPublic


System Information
Windows 7 SP1 64bit, NVidia GTX 580

Blender Version
Broken: 2.78c e92f235283
Worked: 2.76

Short description of error
Having Blender started by a web worker, (blender.exe -b -noaudio scene.blend) the following error is thrown:

Fatal Python error: Py_Initialize: can't initialize sys standard streams OSError: [WinError 6] The handle is invalid Current thread 0x00002f78 (most recent call first):

Exact steps for others to reproduce the error

  1. Using VisualStudio create an empty WebAPI application.
  2. Prepare a Blender Scene with the following script, allow autorun of scripts


  1. On a GET request let it run Blender in a separate process and wait for it to finish rendering the scene (2.78 will dead-block, 2.76 will finish)
  2. Publish to IIS (do not use Visual Studio's internal IIS Express)
  3. Send the GET and see what happens

Due to a bug in Python 3.5.2 Blender will not even initialize and it will block the console with an error message. Make suer to redirect stderr properly to read the error (pasted above).

My solution was to replace the bundled Python with 3.5.3. I described it here:

The problem was obviously introduced with Python 3.5 which was bundled since Blender 2.77. Fortunately Python 3.5.3 fixes it. I hope you will use 3.5.3 in the next Blender release :)


Aaron Carlisle (Blendify) triaged this task as "Confirmed" priority.May 4 2017, 4:57 PM

Sounds reasonable, for 2.8 we will use 3.6 but I guess we should update to 3.5.3 for 2.79.

Even though this is rather exotic and corner case issue, am not totally opposed to the idea of updating our Python version, but that means we need platform maintainers available now - Windows and Linux should not be an issue, OSX is a bit more complicated these days. @jens verwiebe (jensverwiebe) or @Martijn Berger (juicyfruit) , is one of you available to rebuild OSX python to 3.5.3 and upate the libs repo in coming week or so?

Bastien Montagne (mont29) closed this task as "Resolved".May 19 2017, 7:48 AM
Bastien Montagne (mont29) claimed this task.

Finally we decided to update our python to 3.5.3, linux builds from the buildbot should already be updated now, other platforms will be in coming days. Considering the issue as fixed, thanks for the report.

Thank you very much for fixing :)