community-plugins-mhapi icon indicating copy to clipboard operation
community-plugins-mhapi copied to clipboard

Logchannel crash on non-utf8 home directory path.

Open joepal1976 opened this issue 4 years ago • 1 comments

Current use case: "Tài liệu". From user:

Could not load 8_asset_downloader
Traceback (most recent call last):
  File "./core\mhmain.py", line 580, in loadPlugin
    module.load(self)
  File "C:\Program Files\makehuman-community\makehuman\plugins\8_asset_downloader\__init__.py", line 38, in load
    downloadView = category.addTask(AssetDownloadTaskView(category))
  File "C:\Program Files\makehuman-community\makehuman\plugins\8_asset_downloader\assetdownload.py", line 69, in __init__
    self.log = mhapi.utility.getLogChannel("assetdownload")
  File "C:\Program Files\makehuman-community\makehuman\plugins\1_mhapi\_utility.py", line 119, in getLogChannel
    self.logChannels[name] = LogChannel(name,defaultLevel,mirrorToMHLog)
  File "C:\Program Files\makehuman-community\makehuman\plugins\1_mhapi\logchannel.py", line 42, in __init__
    f.write("--- " + self.fileName + " ---\n\n")
  File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode character '\u0300' in position 30: character maps to <undefined>

joepal1976 avatar Apr 29 '20 07:04 joepal1976

Don't think it'll make a difference. Most of that file path encoding should be done by Python automatically. And when that fails, I'm rather convinced we won't do a better job... BTW, do we know more about a) the Python version and b) the operating system in question, besides it's some Windows flavor? And what's that zip stuff in the file path? The application hopefully was unzipped before usage?

Aranuvir avatar Apr 29 '20 09:04 Aranuvir