non-ASCII characters in --producer metadata field breaks app #145

Closed
opened 2022-06-24 08:01:55 +00:00 by Ghost · 3 comments

in img2pdf version 0.4.0, Debian stable, if you try to use characters with accents in the --producer field, the app throws an error:
QUOTE
ERROR:root:error: 'ascii' codec can't encode character '\xf4' in position 4: ordinal not in range(128)
UNQUOTE

all other metadata fields work ok.

sample command:

img2pdf -s 300dpi image.jpg -o test.pdf --title "Râdio" --creator "Maëstro" --author "José" --producer "No unicode here or else it breaks" --keywords "touché"

in img2pdf version 0.4.0, Debian stable, if you try to use characters with accents in the --producer field, the app throws an error: QUOTE ERROR:root:error: 'ascii' codec can't encode character '\xf4' in position 4: ordinal not in range(128) UNQUOTE all other metadata fields work ok. sample command: img2pdf -s 300dpi image.jpg -o test.pdf --title "Râdio" --creator "Maëstro" --author "José" --producer "No unicode here or else it breaks" --keywords "touché"
Owner

thank you for your bug report!

unfortunately I'm unable to reproduce your problem on debian stable. the error you cite sounds like a python2 error but img2pdf in debian stable uses python3.

are you sure that you are using the packaged img2pdf and that you do not have any other python installation around like from pypi or similar?

for example, can you paste the output of this command:

head -1 /usr/bin/img2pdf

and if that says python3, try running the command you showed above with /usr/bin/img2pdf instead of img2pdf and see if that works, thanks!

thank you for your bug report! unfortunately I'm unable to reproduce your problem on debian stable. the error you cite sounds like a python2 error but img2pdf in debian stable uses python3. are you sure that you are using the packaged img2pdf and that you do not have any other python installation around like from pypi or similar? for example, can you paste the output of this command: head -1 /usr/bin/img2pdf and if that says python3, try running the command you showed above with `/usr/bin/img2pdf` instead of `img2pdf` and see if that works, thanks!
Owner

Hi @Ghost can you give more input? Since I cannot reproduce your issue I cannot further assust you without your help.

Hi @Ghost can you give more input? Since I cannot reproduce your issue I cannot further assust you without your help.
Owner

Since there were no further replies, I'm going to close this. Reopen if there is any further input on this problem.

Since there were no further replies, I'm going to close this. Reopen if there is any further input on this problem.
josch closed this issue 2022-09-23 20:32:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: josch/img2pdf#145
No description provided.