Package: pdfposter
X-Debbugs-Cc: [email protected]
Version: 0.8.1-4
Severity: important
Dear Maintainer,
On a PDF file generated by inkscape, pdfposter fails with this error:
$ pdfposter workers.pdf -v -s2.25 -m Let foo.odf
---- processing page 1 -----
Deciding for 3 columns and 2 rows of portrait pages.
Traceback (most recent call last):
File "/usr/bin/pdfposter", line 33, in <module>
sys.exit(load_entry_point('pdftools.pdfposter==0.8.1',
'console_scripts', 'pdfposter')())
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/share/pdfposter/pdftools/pdfposter/cmd.py", line 192, in
run
main(args, infilename=args.infilename,
outfilename=args.outfilename)
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/pdfposter/pdftools/pdfposter/__init__.py", line
350, in main
posterize(outpdf, page, opts.media_size, opts.poster_size,
opts.scale,
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
opts.use_ArtBox)
^^^^^^^^^^^^^^^^
File "/usr/share/pdfposter/pdftools/pdfposter/__init__.py", line
282, in posterize
_scale_pdf_page(outpdf, page, scale)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/pdfposter/pdftools/pdfposter/__init__.py", line
257, in _scale_pdf_page
content = ContentStream(page["/Contents"].get_object(), None)
File
"/usr/lib/python3/dist-packages/pypdf/generic/_data_structures.py", line
1198, in __init__
stream_data = stream.get_data()
File
"/usr/lib/python3/dist-packages/pypdf/generic/_data_structures.py", line
1418, in get_data
new_data.write(operator)
~~~~~~~~~~~~~~^^^^^^^^^^
TypeError: a bytes-like object is required, not 'str'
I tried removing and re-installing the package, with no effect.
Google AI suggests:
The error a bytes-like object is required in pdfposter typically
occurs because of a conflict between Python 2 and Python 3 or an
outdated dependency. The issue arises because Python 3 strictly
distinguishes between strings (Unicode text) and bytes (binary data),
while Python 2 did not. 
Solution 1: Use an updated version
The most direct cause of this error is using an old version of
pdfposter that was built for Python 2. Versions 0.7 and earlier did
not support Python 3 and used an outdated library (pyPdf). A fix was
implemented in version 0.8 to make it Python 3 compatible by switching
to PyPDF2.
I see there have been several new versions released this summer.
Pdfposter version 0.9 included a port to version 3 of the pypdf
library, so I expect just packaging a current version would fix the
problem.
-- System Information:
Debian Release: forky/sid
APT prefers unstable
APT policy: (700, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.12.6-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE
not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages pdfposter depends on:
ii libjs-jquery 3.7.1+dfsg+~3.5.33-1
ii libjs-sphinxdoc 8.1.3-5
ii libjs-underscore 1.13.4~dfsg+~1.11.4-3
ii python3 3.13.7-1
ii python3-pypdf 5.4.0-1
pdfposter recommends no packages.
pdfposter suggests no packages.
-- no debconf information