Make HPLIP working with Python 3

Bug #1275353 reported by Till Kamppeter
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
HPLIP
Wishlist
Gaurav Sood
hplip (Fedora)
New
Undecided
Unassigned
hplip (Ubuntu)
High
Unassigned
Trusty
High
Unassigned

Bug Description

In Ubuntu Linux we want to switch over completely to Python 3 and are on the way to eliminate everything which needs Python 2.

Therefore I want to know whether HPLIP is already tested with Python 3 at HP and whether there was already effort on adapting HPLIP to Python 3.

As Python 3 will also get standard in the other distros I would appreciate very much if HPLIP could be switched over to using Python 3.

Revision history for this message
Suma Byrappa (suma-byrappa) wrote :

Hi Till,

We are already working towards supporting Python 3. We will be releasing HPLIP with support for Python 3 shortly.

Regards,
Suma

Changed in hplip:
importance: Undecided → Wishlist
assignee: nobody → Gaurav Sood (gaurav-sood)
status: New → In Progress
Matthias Klose (doko)
Changed in hplip (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-14.04-beta-1
status: New → Confirmed
Revision history for this message
Ichigo (togmolodon66) wrote :

Hi,

What's the latest on HPLIP's ETA in Trusty?

Compiling version 3.14.4 from source does not work either.

Thanks!

Revision history for this message
Robert Kuska (rkuska) wrote :

Hi,

What's the status on Python3 support? Compiling latest (3.14.6) version with Python3 does not work.

Fedora will switch to Python3 as default in f22 and therefore we need hplip to work with Python3. Can you comment on progress, provide actual patches? I am willing to help if needed.

Thank you.

Revision history for this message
Suma Byrappa (suma-byrappa) wrote :

Hi Robert,

HPLIP's support for Python 3 is in final testing stage. We will be making a release in around a month's time.

Regards,
Suma

Revision history for this message
Miro Hrončok (churchyard) wrote :

Hi, any progress?

Revision history for this message
Suma Byrappa (suma-byrappa) wrote :

Hi,

We will release this support in a few days. We will update this bug.

Regards,
Suma

Revision history for this message
Sanjay Kumar (sanjay-kumar14) wrote :

Changing status to "Fix released" as Python3 support is now available in HPLIP-3.15.2 version.

Changed in hplip:
status: In Progress → Fix Released
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Uploaded HPLIP 3.15.2 to Vivid, so HPLIP in Vivid is Python3-based now.

Changed in hplip (Ubuntu):
status: Confirmed → Fix Released
milestone: ubuntu-14.04-beta-1 → none
Revision history for this message
dino99 (9d9) wrote :

hi Till,

got some vivid packages for upgrading to 3.15.2, but hplip-gui & hplip-data are still at 3.14.6 version
so the upgrade can't be done due to conflict

please upgrade all the related packages.

tags: added: vivid
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

dino99, the developers only upload source packages and a build server generates the binares for all platforms which get distributed to all download mirrors. Perhaps at the time when you updated not all binary packages made it to your mirror. Please do another update now. The missing packages should have arrived already.

Revision history for this message
dino99 (9d9) wrote :

As per the top list, the missing upgraded packages, should have been built but they are not.
https://launchpad.net/ubuntu/+source/hplip

Revision history for this message
Matthias Klose (doko) wrote :

Function `PyString_FromStringAndSize' implicitly converted to pointer at pcard/pcardext/pcardext.c:208
Function `Py_InitModule4' implicitly converted to pointer at pcard/pcardext/pcardext.c:238

Our automated build log filter detected the problem(s) above that will
likely cause your package to segfault on architectures where the size of
a pointer is greater than the size of an integer, such as ia64 and amd64.

This is often due to a missing function prototype definition.

Since use of implicitly converted pointers is always fatal to the application
on ia64, they are errors. Please correct them for your next upload.

More information can be found at:
http://wiki.debian.org/ImplicitPointerConversions

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I have looked into whether there is an easy fix but I have found out that the functions PyString_FromStringAndSize() and Py_InitModule4() were both removed from the API in Python3. Probably the compiling step did not find these functions and did a so-called "implicit declaration" with integer return value leading to the warnings.

What we need is a Python3 replacement of these 2 functions. It seems that the pcard/pcardext/pcardext.c C extension was not correctly converted to Python3 but as it is only rarely ued (very old MF devices) it was not discovered.

Unfortunately I did not find a quick workaround by somehow deactivating the old memory card support.

Reopening for this missing part of the Python3 conversion.

To the HPLIP developers at HP. Can you please fix this quickly and attach a patch here so that we can quickly release this HPLIP package? Thanks.

Changed in hplip:
status: Fix Released → Confirmed
Changed in hplip (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
dino99 (9d9) wrote :

Note: to avoid upcoming upgrading issues, it should be preferable to remove the 3.15.2 packages from "proposed" archive

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

dino99, I got the patch to fix the build server problem from HP now and will upload a new package with raised Ubuntu release number (-0ubuntu2). This will make all working again.

Changed in hplip:
status: Confirmed → In Progress
Changed in hplip (Ubuntu):
status: Confirmed → In Progress
Changed in hplip (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
dino99 (9d9) wrote :

Thanks Till for the quick fix
all the packages have been built and the upgrade goes smoothly.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package hplip - 3.15.2-0ubuntu2

---------------
hplip (3.15.2-0ubuntu2) vivid; urgency=low

  * debian/patches/pcardext-python3-workaround-upstream.patch: Workaround
    patch for missing Python3 transition of the old (pre-USB-storage) photo
    memory card support (pcardext) as this part builds in Python3 environments
    but with pointer-related warnings which are fatal errors for Ubuntu's build
    servers. The patch silences the warnings but the memory card support is
    dropped in Python3 environments. This patch is supplied by the HPLIP
    upstream developers and will be replaced by a more proper solution in the
    next upstream release of HPLIP (see LP: #1275353).
 -- Till Kamppeter <email address hidden> Wed, 6 Feb 2015 11:18:00 -0200

Changed in hplip (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Dimitri John Ledkov (xnox) wrote : Re: [Bug 1275353] Re: Make HPLIP working with Python 3

On 6 February 2015 at 12:46, dino99 <email address hidden> wrote:
> Note: to avoid upcoming upgrading issues, it should be preferable to
> remove the 3.15.2 packages from "proposed" archive
>

huh? vivid-proposed must not be used by humans, and should not be
enabled during development stage of the release.
it is guaranteed to contain broken packages, and has upgrade skew.
vivid suite on the other hand is safe-guarded away from such breaks.

--
Regards,

Dimitri.

Changed in hplip:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers