Fix UnicodeEncodingError, which prevents netrender, reprojection and playback from working on Windows in certain situations.
Users can set their machine name to something containing non-ascii characters. In Python this currently causes problem due to socket.gethostname() throwing UnicodeEncodingError. Work around this by not using platform.system() (which uses internally socket.gethostname()). See http://www.pasteall.org/16215 for backtrace
This commit is contained in:
@@ -32,8 +32,13 @@ BLENDER_PATH = sys.argv[0]
|
||||
CANCEL_POLL_SPEED = 2
|
||||
MAX_TIMEOUT = 10
|
||||
INCREMENT_TIMEOUT = 1
|
||||
try:
|
||||
system = platform.system()
|
||||
except UnicodeEncodingError:
|
||||
import sys
|
||||
system = sys.platform
|
||||
|
||||
if platform.system() == 'Windows' and platform.version() >= '5': # Error mode is only available on Win2k or higher, that's version 5
|
||||
if system in ('Windows', 'win32') and platform.version() >= '5': # Error mode is only available on Win2k or higher, that's version 5
|
||||
import ctypes
|
||||
def SetErrorMode():
|
||||
val = ctypes.windll.kernel32.SetErrorMode(0x0002)
|
||||
|
Reference in New Issue
Block a user