[Patch] hp-align fails at /usr/share/hplip/base/maint.py:433 with TypeError: sequence item 0: expected str instance, bytes found

Bug #1916407 reported by bircoph
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned
hplip (Gentoo Linux)
Fix Released
Medium

Bug Description

Hi!

hp-align from hplip 3.20.11 fails after reading user input with correction values (see log below).

This happens because python 2->3 porting was not complete and binary values were mixed into string's join operator. Proposed patch fixes this issue and hp-align works properly: I verified that boxes are aligned as expected.

$ hp-align

HP Linux Imaging and Printing System (ver. 3.20.11)
Printer Cartridge Alignment Utility ver. 5.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Using device : hp:/usb/Deskjet_5400_series?serial=XXXXXXXXXX

A page will be printed.
Please load plain paper into the printer. Press <enter> to continue or 'q' to quit:
Enter the numbered box on line A where the inner lines best line up with the outer lines (1-23): 12
Enter the numbered box on line B where the inner lines best line up with the outer lines (1-17): 11
Enter the numbered box on line C where the inner lines best line up with the outer lines (1-23): 12
Enter the numbered box on line D where the inner lines best line up with the outer lines (1-23): 10
Enter the numbered box on line E where the inner lines best line up with the outer lines (1-9): 3
Enter the numbered box on line F where the inner lines best line up with the outer lines (1-9): 3
Enter the numbered box on line G where the inner lines best line up with the outer lines (1-9): 4
Enter the numbered box on line H where the inner lines best line up with the outer lines (1-9): 3
Traceback (most recent call last):
  File "/usr/bin/hp-align", line 207, in <module>
    maint.AlignType10(d, tui.load_paper_prompt, type10and11and14Align)
  File "/usr/share/hplip/base/maint.py", line 397, in AlignType10
    alignType10Phase2(dev, values, pattern)
  File "/usr/share/hplip/base/maint.py", line 433, in alignType10Phase2
    i, p = 0, ''.join([pcl.UEL, '\n'])
TypeError: sequence item 0: expected str instance, bytes found

Python-3.8 is being used as python interpreter.

Revision history for this message
bircoph (bircoph) wrote :
tags: added: patch python3
bircoph (bircoph)
summary: - hp-align fails at /usr/share/hplip/base/maint.py:433 with TypeError:
- sequence item 0: expected str instance, bytes found
+ [Patch] hp-align fails at /usr/share/hplip/base/maint.py:433 with
+ TypeError: sequence item 0: expected str instance, bytes found
Changed in hplip (Gentoo Linux):
importance: Unknown → Medium
Changed in hplip (Gentoo Linux):
status: Unknown → Fix Released
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.