Open mmoales opened 2 years ago
The encoding issue was actually due to some weird characters in our python doc strings. Once those were removed, the encoding option is no longer needed when reading the python files. Here are my current changes in generator.py
- cmd += f'--python_out={rndpath} --grpc_python_out={rndpath} {proto_glob}'
+ cmd += f'--python_out={rndpath} --grpc_python_out={rndpath} '
+
+ # Windows does not automatically expand *.proto when executing the command
+ if platform.system() == "Linux":
+ cmd += f'{proto_glob}'
+ else:
+ for proto_file in files:
+ cmd += f'{proto_file} '
š Before submitting the issue
š Description of the bug
Running the tool on Windows 10 results in ".proto: No such file or directory" error. This is because .proto is not automatically expanded when the command is executed in either PowerShell or a command prompt on Windows 10. For example:
To fix this locally, I modified generator.py in my local site-packages as follows:
After making this change, I then get an encoding error:
To fix this, I made an additional change:
š Steps to reproduce
Using a command prompt or PowerShell on Windows 10, run the command to generate python code in a project that has multiple .proto files.
š» Which operating system are you using?
Windows
š Which Python version are you using?
3.9
š¦ Installed packages