NVDA fails to start when temp path contains certain multibyte characters #2729

Closed
nvaccessAuto opened this Issue Oct 18, 2012 · 7 comments

1 participant

@nvaccessAuto

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.

@nvaccessAuto

Comment 1 by mdcurran on 2012-10-18 10:50
Fixed in 2f4847f
Changes:
State: closed

@nvaccessAuto

Comment 2 by jteh on 2012-10-19 02:30
I've added a comment to PythonIssue:14255 concerning this issue.

@nvaccessAuto

Comment 3 by jteh on 2012-10-19 06:58
Reworked fix in f6a3112 to address further reported issues.

@nvaccessAuto

Comment 4 by jteh on 2012-10-31 00:29
Further change in 2dbb881.

@nvaccessAuto

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.

@nvaccessAuto

Comment 6 by nvdakor on 2014-06-08 17:01
Hi,
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.
Thanks.

@nvaccessAuto

Comment 7 by nvdakor on 2014-06-08 17:20
Hi,
A temporary fix is available (for users of Python 2.7.6/2.7.7.):

  • URL: git://git.nvaccess.org/nvda.git
  • Branch: t2729
  • Commit ID: 1a826bf Thanks.
@nvaccessAuto nvaccessAuto added the bug label Nov 10, 2015
@nvaccessAuto nvaccessAuto added this to the 2012.3 milestone Nov 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment