Improved debugging for failed extension imports

Bug #434716 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When failing to import an extension, it can fail in ways that we don't
get a good import error exception.

Specifically, I just ran into a case where we failed to import
_chk_map_pyx.pyx because it depended on zlib1.dll. And while that dll
was in the path, the permissions were set such that it could not be
loaded as a dll (read but not execute).

Under that circumstance, the failure message was simply:
0.812 failed to load extensions: ['DLL load failed: Access is denied.']

There would be a couple possible helpers here:

 1) Change the api to be:

- -def failed_to_load_extension(exception):
+def failed_to_load_extension(name, exception):

(or we could make name an optional second argument if we wanted
backwards compatibility).

 2) Change -Derror (or add a new flag) such that if an extension fails
to load, we either raise the import exception directly, or we give a
quick traceback of the failure.

I actually found the problem because while changing the interface, I got
a clear traceback with the code that was failing to import but had not
been updated yet... :)

Both would be fine for me. I think most cases of an extension failing to
import will include the module, so having to update all the locations is
probably overkill.

John
=:->

  affects bzr
  status confirmed
  importance medium
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkq48PEACgkQJdeBCYSNAAPEgACgkxUR/0nAY8z7ysCNt1zV/DSz
OZYAoJLVi3oKpltBJPZzNQNQ2Bye9Vsk
=utpJ
-----END PGP SIGNATURE-----

Jelmer Vernooij (jelmer)
tags: added: extensions
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.