nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.1k stars 634 forks source link

threshold_py3_staging cannot install addons #9838

Closed nishimotz closed 5 years ago

nishimotz commented 5 years ago

Steps to reproduce:

Actual behavior:

error occurs as follows

INFO - __main__ (14:00:34.233):
Starting NVDA
INFO - external:core.main (14:00:34.623):
Config dir: C:\Applications\nvda_th_py3\userConfig
INFO - external:config.ConfigManager._loadConfig (14:00:34.623):
Loading config: .\userConfig\nvda.ini
INFO - external:core.main (14:00:34.639):
Developer Scratchpad mode enabled
INFO - external:core.main (14:00:34.733):
NVDA version threshold_py3_staging-17851,779ca15b
INFO - external:core.main (14:00:34.733):
Using Windows version 10.0.18362 workstation
INFO - external:core.main (14:00:34.733):
Using Python version 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)]
INFO - external:core.main (14:00:34.733):
Using comtypes version 1.1.7
INFO - external:core.main (14:00:34.733):
Using configobj version 5.1.0 with validate version 1.0.1
INFO - external:synthDriverHandler.setSynth (14:00:36.210):
Loaded synthDriver nvdajp_jtalk
INFO - external:core.main (14:00:36.210):
Using wx version 4.0.3 msw (phoenix) wxWidgets 3.0.5 with six version 1.12.0
INFO - external:brailleInput.initialize (14:00:36.226):
Braille input initialized
INFO - external:braille.initialize (14:00:36.226):
Using liblouis version 3.10.0
INFO - external:braille.initialize (14:00:36.226):
Using pySerial version 3.4
INFO - external:braille.BrailleHandler.setDisplayByName (14:00:36.226):
Loaded braille display driver noBraille, current display has 0 cells.
INFO - external:_UIAHandler.UIAHandler.MTAThreadFunc (14:00:36.468):
UIAutomation: IUIAutomation6
INFO - external:core.main (14:00:36.653):
NVDA initialized
ERROR - external:gui.addonGui.installAddon (14:01:14.624):
Error installing  addon bundle from C:\work\nvda\focusHighlight\focusHighlight-6.1.nvda-addon
Traceback (most recent call last):
  File "C:\projects\nvda\source\gui\addonGui.py", line 552, in installAddon
  File "C:\projects\nvda\source\gui\__init__.py", line 915, in __init__
  File "C:\projects\nvda\source\gui\__init__.py", line 919, in run
  File "C:\projects\nvda\source\addonHandler\__init__.py", line 237, in installAddonBundle
  File "C:\projects\nvda\source\addonHandler\__init__.py", line 294, in __init__
  File "C:\projects\nvda\source\addonHandler\__init__.py", line 695, in __init__
  File "C:\projects\nvda\include\configobj\src\configobj\__init__.py", line 1199, in __init__
  File "C:\projects\nvda\include\configobj\src\configobj\__init__.py", line 1249, in _load
UnicodeDecodeError: 'cp932' codec can't decode byte 0x88 in position 40: illegal multibyte sequence

Expected behavior:

the error should not occur

System configuration

NVDA installed/portable/running from source:

portable

NVDA version:

threshold_py3_staging-17851,779ca15b

Windows version:

Windows 10 Version 1903, Japanese (ANSI locale i.e. cp932)

Name and version of other software in use when reproducing the issue:

Other information about your system:

Other questions

Does the issue still occur after restarting your PC?

Have you tried any other versions of NVDA? If so, please report their behaviors.

Python 2 based NVDA should work as expected.

LeonarddeR commented 5 years ago

The instances that call open to parse manifests didn't pass the proper encoding. I'm about to push a try build to fix this, along with two other instances of open that needed attention. However, manifests in the zipfile are opened with zipfile.ZipFile.open, and that always opens in binary mode. configobj should be able to handle this, though. I added explanatory comments for this.

A try build is on the way.

LeonarddeR commented 5 years ago

@nishimotz: Could you please test this try build? Regardless what I did, I was able to install Focus Highlight just fine, even if I set my NVDA language to Japanese. However, the open function uses the system encoding by default.

nishimotz commented 5 years ago

Thank you. I will check later.

nishimotz commented 5 years ago

confirmed that try-python3-open-17889,cceb1f96 can install Focus Highlight 6.1 as expected.

In Japan, system encoding for non-Unicode programs is usually cp932. Current version of Windows 10 has the option for changing it to UTF-8, however, most domestic software do not work correctly with that.

nishimotz commented 5 years ago

nvda_snapshot_pr9853-17905,6092429c.exe is tested as well.

9853

feerrenrut commented 5 years ago

Fixed in PR #9853 with commit 74431b8