mondeja / mdpo

Markdown files translation using GNU PO files
https://mondeja.github.io/mdpo/
BSD 3-Clause "New" or "Revised" License
25 stars 5 forks source link

po2md -w 0 triggers TypeError: argument 'width': 'float' object cannot be interpreted as an integer #275

Closed SantosSi closed 1 year ago

SantosSi commented 1 year ago

Installed on Debian Bookworm through pipx install mdpo using python 3.11. po2md -q --wrapwidth 0 --po-encoding UTF-8 -p translated.po -s output.md input.md (FYI: same for --wrapwidth INF / -w 0 / -w INF / -w -1)

Traceback (most recent call last): File "/home/user/.local/bin/po2md", line 8, in sys.exit(main()) ^^^^^^ File "/home/user/.local/pipx/venvs/mdpo/lib/python3.11/site-packages/mdpo/po2md/main.py", line 139, in main raise SystemExit(run(args=sys.argv[1:])[1]) # pragma: no cover ^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/pipx/venvs/mdpo/lib/python3.11/site-packages/mdpo/po2md/main.py", line 122, in run output = po2md.translate( ^^^^^^^^^^^^^^^^ File "/home/user/.local/pipx/venvs/mdpo/lib/python3.11/site-packages/mdpo/po2md/init.py", line 964, in translate parser.parse( File "/home/user/.local/pipx/venvs/mdpo/lib/python3.11/site-packages/mdpo/po2md/init.py", line 623, in leave_block self._save_current_msgid() File "/home/user/.local/pipx/venvs/mdpo/lib/python3.11/site-packages/mdpo/po2md/init.py", line 427, in _save_current_msgid translation = md_ulb_pwrap.ulb_wrap_paragraph( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument 'width': 'float' object cannot be interpreted as an integer

Does not happen when dropping the -w option at all or using other numbers, e.g. 78, 80 or 32000.

mondeja commented 1 year ago

Thanks for the report and sorry for the inconvenience, it is fixed in v1.1.3.