Closed etfre closed 2 years ago
Good find! However, I think this may now be moot in the latest versions, which don't need to use the command line utilities. Can you give it a try?
Relatedly, I am working on improving freezing. I haven't tried cx_freeze, but I have had success with using winpython.
Sorry for the late response. I can reproduce this in 2.1.0 as well, even without freezing:
File "C:\Program Files (x86)\GOG Galaxy\Games\Stardew Valley\Mods\StardewSpeak\StardewSpeak\lib\speech-client\lib\site-packages\kaldi_active_grammar\utils.py", line 194, in load_symbol_table
with open(filename, 'r', encoding='utf-8') as f:
OSError: [Errno 22] Invalid argument: '"C:\\Program Files (x86)\\GOG Galaxy\\Games\\Stardew Valley\\Mods\\StardewSpeak\\StardewSpeak\\lib\\speech-client\\models\\kaldi_model\\phones.txt"'
Removing the above line in the Model __init__ method still fixes the issue for me.
@evfredericksen Hmm, strange. Thanks for the report and retest! I will try to figure out what is causing it.
No problem. I don't have context for why the line was added originally, but I would think that the quotation marks around the path are unnecessary as Python should be able to handle whitespace in paths without any extra logic.
https://stackoverflow.com/questions/14852140/whitespaces-in-the-path-of-windows-filepath
Sample script:
import os
path_with_whitespace = os.path.join(os.getcwd(), "text.txt")
print(path_with_whitespace)
with open(path_with_whitespace) as f:
pass
with open(f'"{path_with_whitespace}"') as f:
pass
Result:
C:\Users\evfre\wp\test path\text.txt
Traceback (most recent call last):
File "r.py", line 6, in <module>
with open(f'"{path_with_whitespace}"') as f:
OSError: [Errno 22] Invalid argument: '"C:\\Users\\evfre\\wp\\test path\\text.txt"'
I'm running into the following error when I try to use a model that contains a whitespace in its path:
However, when I comment out the line
self.files_dict.update({ k: '"%s"' % v for (k, v) in self.files_dict.items() if v and ' ' in v })
in the Model constructor, everything works as expected.