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.
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.