ValueError: need more than 3 values to unpack

Bug #1589949 reported by Sanguinario_Joe
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Debian
New
Undecided
Unassigned
assimp (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Importing pyassimp will return a failure:

>>> import pyassimp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/pyassimp/__init__.py", line 1, in <module>
    from .core import *
  File "/usr/lib/python2.7/dist-packages/pyassimp/core.py", line 29, in <module>
    class AssimpLib(object):
  File "/usr/lib/python2.7/dist-packages/pyassimp/core.py", line 33, in AssimpLib
    load, load_mem, release, dll = helper.search_library()
ValueError: need more than 3 values to unpack

It is caused by helper, which is not returning separate load and load_mem objects anymore.

---

lsb_release -rd
Description: Ubuntu 16.04 LTS
Release: 16.04

---

apt-cache policy python-pyassimp
python-pyassimp:
  Instalados: 3.2~dfsg-3
  Candidato: 3.2~dfsg-3
  Tabla de versión:
 *** 3.2~dfsg-3 500
        500 http://es.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        500 http://es.archive.ubuntu.com/ubuntu xenial/universe i386 Packages
        100 /var/lib/dpkg/status

Tags: patch
Revision history for this message
Sanguinario_Joe (lacigarracomunista) wrote :
Revision history for this message
Sanguinario_Joe (lacigarracomunista) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "A quite simple Patch to fix that" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Brian Murray (brian-murray) wrote :

Thank you for providing a patch for this bug report. This particular package is synchronized with Debian so it would be quite helpful if you were to forward the patch to the Debian bug tracker. You can learn more about how to use the Debian bug tracker at https://wiki.ubuntu.com/Debian/Bugs. After you've forwarded the bug report and patch please add a bug watch, following the procedure at http://wiki.ubuntu.com/Bugs/Watches, so we can track the progress of the upstream bug report.

Revision history for this message
Robert Haschke (rhaschke) wrote :

Trying to report the bug on Debian, reportbug complained that there is already a newer version available (https://sources.debian.net/patches/assimp/3.3.1~dfsg-1 in unstable). Not sure, how to proceed.

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in assimp (Ubuntu):
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package assimp - 3.3.1~dfsg-4

---------------
assimp (3.3.1~dfsg-4) unstable; urgency=medium

  * Fixed pyassimp import for good.

 -- IOhannes m zmölnig (Debian/GNU) <email address hidden> Wed, 24 Aug 2016 23:06:28 +0200

Changed in assimp (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Dave Coleman (davetcoleman) wrote :

Will this be released into 16.04? My current libassimp-dev version is 3.2. This bug is affecting software I maintain. Thanks!

Revision history for this message
Jordan Lack (jlack1987) wrote :

Also still suffering from this bug

Revision history for this message
Guillaume W. (guihome) wrote :

The patch provided by Sanguinario_Joe (lacigarracomunista) applies above the maintainer's patch which modifies the helper.py and returns only (load, release) tuple instead of the awaited (load, load_mem, release).

It indeed fixes importing but breaks the usage of the load method because load is returned not load_mem. This load is used in the package maintained by Dave Coleman (moveit_commander) and this how it failed at my side after applying the patch.

here down is the proof:
Looking deeper at the maintainer's patch for Xenial [assimp_3.2~dfsg-3.debian.tar.xz] the pyassimp.patch does this
+ try:
+ load = LIBASSIMP.aiImportFile
+ release = LIBASSIMP.aiReleaseImport
+ except AttributeError:

and in yakkety this similar patch does this (additional export is from 3.3 version of the lib)
+ try:
+ load = LIBASSIMP.aiImportFile
+ load_mem = LIBASSIMP.aiImportFileFromMemory
+ export = LIBASSIMP.aiExportScene
+ release = LIBASSIMP.aiReleaseImport

one can see that the returned function are (load, release) not (load_mem, release) as assumed by Sanguinario_Joe.
I think the correct patch for the xenial version should remove the load_mem function as in my provided patch

Overall, imho, the maintainers could provide a correct patch for xenial by adding this one line
+ load_mem = LIBASSIMP.aiImportFileFromMemory and do need to backpart the 3.3 version on xenial

I hope this helps.

Revision history for this message
Guillaume W. (guihome) wrote :

Of course I wanted to say *DON'T* need to backport 3.3 to xenial, just fix the patch in 3.2

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.