zopefoundation/ZConfig

the `openPackageResource` method passes an explicit `utf-8` encoding to `decode()

Closed this issue · 0 comments

cygir commented

Values with no-ascii characters can't be use in the configuration file:

File "c:\users\cyril\dev\projects\cablesim\envs\adk-2-bw\python27\lib\site-packages\ZConfig\loader.py", line 230, in openResource
data = file.read().decode()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 254: ordinal not in range(128)

The solution is:
the openPackageResource method passes an explicit utf-8 encoding to `decode()