Device Information/Status History is showing unformatted QDateTime objects

Bug #1956547 reported by FeRD (Frank Dana)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned

Bug Description

Under Python 3 with PyQt5, the string representation of PyQt5.QtCore.QDateTime is not a formatted string. So, the "Date/Time" column of the Device Information dialog's Status History tab is displaying values like:

PyQt5.QtCore.QDateTime(2022,1,5,21,51,53)

There are two possible fixes for this, I'm attaching patches for both approaches. They are compatible with each other and could be applied together, but either patch alone is sufficient to fix the problem.

Patch 1:
To fix the display of this particular column, only, the call to value_str(dt)
in ui5/infodialog.py can be changed to
value_str(dt.toString())

Patch 2:
To fix this for all QDateTime values in the system, value_str can be made to detect the type and apply data.toString() even when running under Python 3. (It will always apply data.toString(), under Python 2.)

Revision history for this message
FeRD (Frank Dana) (ferdnyc) wrote :
Revision history for this message
FeRD (Frank Dana) (ferdnyc) wrote :
description: updated
description: updated
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.