-
Notifications
You must be signed in to change notification settings - Fork 6
powrap does not work on Windows #82
Comments
Hi! Thanks for reporting! Can you try this patch: diff --git a/powrap/powrap.py b/powrap/powrap.py
index 17be2f1..d6f515f 100644
--- a/powrap/powrap.py
+++ b/powrap/powrap.py
@@ -48,7 +48,7 @@ def fix_style(po_files, no_wrap=False, quiet=False):
for po_path in tqdm(po_files, desc="Fixing wrapping of po files", disable=quiet):
with open(po_path, encoding="UTF-8") as po_file:
po_content = po_file.read()
- args = ["msgcat", "-", "-o", po_path]
+ args = ["msgcat", "-", "-o", str(po_path)]
if no_wrap:
args[1:1] = ["--no-wrap"]
try: I think it's more a Python 3.6 issue than a Windows issue (but I'm surprised you have msgcat on windows :p) |
Thanks for the quick reply @JulienPalard I actually didn't install msgcat so it is weird. I did try your patch and it actually "worked" not raising any exception except for these messages: (venv) C:\Users\yeyeto2788\workspace\python-docs-es>powrap .\library\othergui.po
Error running msgcat - -o library\othergui.po: [WinError 2] The system cannot find the file specified
Fixing wrapping of po files: 0%| | 0/1 [00:00<?, ?it/s]
(venv) C:\Users\yeyeto2788\workspace\python-docs-es>powrap C:\Users\yeyeto2788\workspace\python-docs-es\library\abc.po
Error running msgcat - -o C:\Users\yeyeto2788\workspace\python-docs-es\library\abc.po: [WinError 2] The system cannot find the file specified
Fixing wrapping of po files: 0%| IMHO this might be somehow expected since I do not have msgcat installed but it is weird having the progress bar stuck on the bottom and the error above the bar. Seems like the actual error is because when it tries to execute the command and it does not find msgcat, but the |
Yes, that's because you don't have msgcat. Some people and I are sometimes trying to get rid of this dependency, as we know it's not trivial to get msgcat on Windows. (I'm starting to think having a Another way to properly indent a |
In the meantime, I used the library on Linux based OS on a VM and it worked flawlessly. Thank you very much for your suggestion on using poedit, I'll keep it in mind for the next time. Do you think https://docs.python.org/3.5/library/textwrap.html does not implement somehow that? If there is anything I can help with just let me know. I did a quick review of the code and I notice there are still lines belonging to the old dependency of msgcat command execution https://github.com/JulienPalard/powrap/blob/from_msgcat/powrap/powrap.py#L43 |
No, that's not the same algorithm. I opened an issue about it: https://bugs.python.org/issue41975
Yes, this is clearly WIP, not working, it's really just the beginning of a proof of concept which does not even really solve the problem: instead of having a dependency on msgcat, we have a dependency on libunistring. |
Steps to reproduce:
git clone https://github.com/yeyeto2788/python-docs-es.git
git checkout traduccion-misc
pip install powrap
powrap .\library\misc.po
Error:
OS: Windows 10
Python: Python 3.6.5
No matter what path I pass over the arguments that I would give me the same error.
P.D: Might not be the best OS in the world but that's what I have for now 😢
The text was updated successfully, but these errors were encountered: