ctalkington / python-ipp

Asynchronous Python client for Internet Printing Protocol (IPP)
MIT License
36 stars 20 forks source link

Print-Job Timeout #596

Open wkuss opened 2 months ago

wkuss commented 2 months ago

In pyipp's serializer.py, the encode_dict function does not handle the data attribute in data, resulting in file data not being sent to the Print device at print-job.

pyipp version: 0.16.0

so-saf commented 2 months ago

@wkuss hi, I ran into a similar problem, my solution was to add the following three lines right to the end of the encode_dict function:

if isinstance(data.get("data"), bytes):
    encoded += data['data']
    encoded += struct.pack(">b", IppTag.END.value)

ipptool generates the contents of http packets similarly. This is probably not the best solution, so I would wait for the author's comments.

so-saf commented 2 months ago

In general, as it turned out, there are lines of code necessary for printing in the source files, the functionality was added as part of PR #510, which was adopted after the last release.

@ctalkington Is there an opportunity to make a new release? This functionality would be useful :)

wkuss commented 1 month ago

Yeah, that's how I worked it out.