Most printer job options have an associated value, but not all. A lack of value should be interpreted as a boolean with a value of true. Our parser however explodes when this happens: > Mar 17 14:51:02 dhcp-254-99.lkpg.cendio.se cupsd[1856]: argv[5]="InputSlot=Default PageSize=A4 noCollate Duplex=None Resolution=300dpi number-up=1 job-uuid=urn:uuid:b16ff36e-a989-3a1f-7cd9-c8bdbd0958d9 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1458222180 time-at-processing=1458222662" > ... > Mar 17 14:51:03 dhcp-254-99.lkpg.cendio.se cupsd[1856]: Traceback (most recent call last): > Mar 17 14:51:03 dhcp-254-99.lkpg.cendio.se cupsd[1856]: File \"/usr/lib/cups/backend/thinlocal\", line 173, in <module> > Mar 17 14:51:03 dhcp-254-99.lkpg.cendio.se cupsd[1856]: sys . exit ( Iiii111Ii11I1 ( ) ) > Mar 17 14:51:03 dhcp-254-99.lkpg.cendio.se cupsd[1856]: File \"/usr/lib/cups/backend/thinlocal\", line 38, in Iiii111Ii11I1 > Mar 17 14:51:03 dhcp-254-99.lkpg.cendio.se cupsd[1856]: I11 = dict ( nv . split ( \"=\" ) for nv in sys . argv [ CUPS_ARGUMENT_OPTIONS ] . split ( \" \" ) ) > Mar 17 14:51:03 dhcp-254-99.lkpg.cendio.se cupsd[1856]: ValueError: dictionary update sequence element #2 has length 1; 2 is required > Mar 17 14:51:03 dhcp-254-99.lkpg.cendio.se cupsd[1856]: PID 2532 (/usr/lib/cups/backend/thinlocal) stopped with status 1. > Mar 17 14:51:03 dhcp-254-99.lkpg.cendio.se cupsd[1856]: Backend returned status 1 (failed)
It does feel wrong that we in out backend interprets all options without values as booleans. Also if we want to pass those options on to the client side we probably want to pass as is without interfering with what default means. Suggestion is to set those to None and when we in the backend needs to use them, apply logic for what default value to use based on datatype.
(In reply to comment #2) > It does feel wrong that we in out backend interprets all options without values > as booleans. Also if we want to pass those options on to the client side we > probably want to pass as is without interfering with what default means. > > Suggestion is to set those to None and when we in the backend needs to use > them, apply logic for what default value to use based on datatype. For example the option date-time-at-processing is an integer timestamp and should probably not default to true value.
Tested without and with the change. Works as expected.