The hp-align crashes after page printing with 'split' python error.

Bug #1903347 reported by kostyarin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned

Bug Description

Ref. (a'k'a reopen) https://bugs.launchpad.net/hplip/+bug/1690516

HPLIP Version
```
HP Linux Imaging and Printing System (ver. 3.20.9)
HPLIP upgrade latest version ver. 1.0
```

Linux: Arch 1.4

Reproduce:

```
hp-align -i -l debug -d <device uri>
```
and after page printing it crashes with output described in the reference above.

In file /usr/share/hplip/base/maint.py
```
    if to_bytes_utf8("manual") in data:
        log.debug("Device supports manual calibration")
        data = status.StatusType10FetchUrl(func, "/Calibration/Session", "<cal:CalibrationState xmlns:cal=\\\"http://www.hp.com/schemas/imaging/con/cnx/markingagentcalibration/2009/04/08\\\" xmlns:dd=\\\"http://www.hp.com/schemas/imaging/con/dictionaries/1.0/\\\">Printing</cal:CalibrationState>")
        import string #
        data = string.split(data, "/Jobs")[1] # <=== S O M W H E R E H E R E
        data = string.split(data, "\r\n")[0] #
        data = "/Jobs" + data
        data = status.StatusType10FetchUrl(func, data)
        data = string.split(data, "Session/")[1]
        data = string.split(data, "<")[0]
        data = "/Calibration/Session/" + data + "/ManualSelectedPatterns.xml"
        global calibrationSession
        calibrationSession = data
        dev.close()
    return 0
```

That's all.

cc @garbulix

Revision history for this message
kostyarin (k-i-r) wrote :

The latest HPLIP is 3.20.9. So, the 1690516 was/is/has not fix released... \0/

Ref.: https://developers.hp.com/hp-linux-imaging-and-printing/gethplip

Revision history for this message
kostyarin (k-i-r) wrote :

The solution, may be, that I used locally debugging the bug

```
    if to_bytes_utf8("manual") in data:
        log.debug("Device supports manual calibration")
        data = status.StatusType10FetchUrl(func, "/Calibration/Session", "<cal:CalibrationState xmlns:cal=\\\"http://www.hp.com/schemas/imaging/con/cnx/markingagentcalibration/2009/04/08\\\" xmlns:dd=\\\"http://www.hp.com/schemas/imaging/con/dictionaries/1.0/\\\">Printing</cal:CalibrationState>")
        log.debug("data:")
        log.debug(data)

        from email import message_from_string
        headers = message_from_string(str(data, 'ASCII').split('\r\n', 1)[1])
        location = headers['Location']
        log.debug("location:")
        log.debug(location)

        data = status.StatusType10FetchUrl(func, location)
        log.debug("StatusType10FetchUrl:")
        log.debug(data)
        data = data.split(b"Session/")[1]
        log.debug(data)
        data = data.split(b"<")[0]
        log.debug(data)
        data = b"/Calibration/Session/" + data + b"/ManualSelectedPatterns.xml"
        log.debug(data)
        global calibrationSession
        calibrationSession = data.decode("utf-8")
        dev.close()
```

attention: lots of useless debug logs

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.