tjfontaine / airprint-generate

Automatically generate AirPrint Avahi service files for CUPS printers
http://www.atxconsulting.com/blog/tjfontaine/2010/11/21/automatically-generate-airprint-avahi-service-files-cups-printers
400 stars 119 forks source link

empty service file created #30

Open Zaoliang opened 3 years ago

Zaoliang commented 3 years ago

I got an empty service file 'AirPrint-hplaserjet100colormfpm175a.service' created:

--

@linux:~/Downloads/airprint-generate> ./airprint-generate.py -v hplaserjet100colormfpm175a Losing support for: text/css,image/x-photocd,image/x-bitmap,image/pwg-raster,application/vnd.cups-raw,application/vnd.cups-postscript,application/vnd.cups-pdf-banner,application/vnd.hp lasercups-pdf Traceback (most recent call last): File "./airprint-generate.py", line 279, in apg.generate() File "./airprint-generate.py", line 226, in generate tree.write(f, pretty_print=True, xml_declaration=True, encoding="UTF-8") File "src/lxml/etree.pyx", line 2057, in lxml.etree._ElementTree.write File "src/lxml/serializer.pxi", line 758, in lxml.etree._tofilelike File "src/lxml/etree.pyx", line 318, in lxml.etree._ExceptionContext._raise_if_stored File "src/lxml/serializer.pxi", line 682, in lxml.etree._FilelikeWriter.write TypeError: write() argument must be str, not bytes

-- My OS: openSUSE Tumbleweed Shared printer connected to printer server: HP Laserjet 100 Color MFP M175a

any idea about this TypeError? Thanks!

tmulzer commented 3 years ago

Same with a kyocera printer and Arch Linux (Manjaro KDE).

tmulzer commented 3 years ago

PullRequest #31 is the solution.