Reported by mdcurran on 2012-10-18 10:42
Python's tempfile.get_default_tempdir() normalizes case on all candidate temp paths. If the path happens to contain multibyte characters this is bad as changing case completely destroys the original value of the path.
For example: the unicode string "川山" is encoded in CP932 (Japanese) as "\x90\xec\x8eR".
If this string is run through os.path.normcase, the final "R" is converted to "r" which is very wrong.
In the end if none of the candidate temp paths can be used due to this reason, or because some of them simply cannot be written to, then tempfile.gettempdir() raises an error and NVDA fails to start.
Its worth noting that if deleting the user's temp and tmp environment variables to try and get around this, the temp path falls back to c:\windows\temp. NVDA also fails hear but not for the reason above. It fails here simply because it cannot create its log file in this directory due to lack of permissions. This particular issue should be handled in a separate ticket.
The text was updated successfully, but these errors were encountered:
Comment 5 by mdcurran on 2013-02-01 18:47
A further fix in c0c5b69. We originally fixed NVDA starts by patching in nvda.pyw, but after further testing it seems that installing was also broken in this particular situation as nvda_slave imports comtypes.client which does things with tempfile.gettempdir. Now both nvda.pyw and nvda_slave.pyw patch tempfile.
Comment 6 by nvdakor on 2014-06-08 17:01
The Python issue has been resolved (according to the message for 14255) in either 2.7.6 or 2.7.7. So if either version fixes this, we might as well remove Python Monkey Patches file for now.