Description of problem: dblatex returns with a cryptic message: TypeError: can't concat str to bytes when I added to the /usr/bin/dblatex try/except/print(traceback.format_exc()) I got the following exception: Unexpected error occured Error: can't concat str to bytes Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/dbtexmf/core/dbtex.py", line 758, in main run.compile() File "/usr/lib/python3.8/site-packages/dbtexmf/core/dbtex.py", line 366, in compile donefiles = self._compile() File "/usr/lib/python3.8/site-packages/dbtexmf/core/dbtex.py", line 436, in _compile self.make_tex() File "/usr/lib/python3.8/site-packages/dbtexmf/core/dbtex.py", line 338, in make_tex self.rawtex.parse(d.rawfile, d.texfile) File "/usr/lib/python3.8/site-packages/dbtexmf/dblatex/rawtex.py", line 81, in parse line = self.figconvert(line) File "/usr/lib/python3.8/site-packages/dbtexmf/dblatex/rawtex.py", line 104, in figconvert line = re.sub(br"{"+fig+br"}", br"{"+newfig+br"}", line) TypeError: can't concat str to bytes Version-Release number of selected component (if applicable): $ rpm -qv dblatex inkscape dblatex-0.3.11-4.fc32.noarch inkscape-1.0-1.fc33.x86_64 I'm not sure wheter is the correct fix but at least this type of change fixes the issue for me: $ diff -u /usr/lib/python3.8/site-packages/dbtexmf/dblatex/rawtex.py.orig /usr/lib/python3.8/site-packages/dbtexmf/dblatex/rawtex.py --- /usr/lib/python3.8/site-packages/dbtexmf/dblatex/rawtex.py.orig 2020-01-29 21:48:34.000000000 +0000 +++ /usr/lib/python3.8/site-packages/dbtexmf/dblatex/rawtex.py 2020-05-07 19:09:40.275932036 +0000 @@ -101,6 +101,10 @@ # If something done, replace the figure in the tex file if newfig != fig: + if isinstance(fig, str): + fig = fig.encode("utf-8") + if isinstance(newfig, str): + newfig = newfig.encode("utf-8") line = re.sub(br"{"+fig+br"}", br"{"+newfig+br"}", line) return line BTW it would be also nice to have by default try/except/print(traceback.format_exc()) in all of the python wrappers located in /usr/bin. I'm not sure is setuptools could do that magically?
- I'm not sure is setuptools could do that magically? + I'm not sure if setuptools could do that magically?
No comment from upstream on this one yet, so I guess I'll go with a local patch. Is it OK to credit you with your bz name and address when I try to upstream the patch?
(In reply to Michael J Gruber from comment #2) > Is it OK to credit you with your bz name and address when I try to upstream the patch? Yes, that's fine.
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle. Changing version to 33.
Sorry for the late reply. There was no direct response upstream to this report, but a new release which was not announced on the devel list and which renamed the package (so no monitoring triggers). The new release does not include your fix, but other fixes there might prevent "mixed string types" from being passed to the function that your patch touches. Can you test with dblatex 0.3.12 from here: Rawhide: https://koji.fedoraproject.org/koji/taskinfo?taskID=62216410 F34: https://koji.fedoraproject.org/koji/taskinfo?taskID=62217189 F33: https://koji.fedoraproject.org/koji/taskinfo?taskID=62217264 Rawhide should show up in the repo soon, the others are scratch builds only so far.
I tested it on the same package which didn't work previously and now it works (see: bug 1833047, comment 8 for more information).
(In reply to Damian Wrobel from comment #6) > I tested it on the same package which didn't work previously and now it > works (see: bug 1833047, comment 8 for more information). Perfect, thanks a lot! Package builds upcoming ...
FEDORA-2021-22912790bc has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-22912790bc
FEDORA-2021-5a6ed5d7ea has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-5a6ed5d7ea
FEDORA-2021-b4faa1684d has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2021-b4faa1684d
FEDORA-2021-22912790bc has been pushed to the Fedora 34 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-22912790bc` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-22912790bc See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-5a6ed5d7ea has been pushed to the Fedora 33 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-5a6ed5d7ea` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-5a6ed5d7ea See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-b4faa1684d has been pushed to the Fedora 32 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-b4faa1684d` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-b4faa1684d See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-5a6ed5d7ea has been pushed to the Fedora 33 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2021-b4faa1684d has been pushed to the Fedora 32 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2021-22912790bc has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report.