--profile-imports should fail gracefully when not installed

Bug #588278 reported by Gary van der Merwe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned
bzr (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

With bzr 2.1.1 installed from the ubuntu lucid repository:

$ bzr rocks --profile-imports
Traceback (most recent call last):
  File "/usr/bin/bzr", line 59, in <module>
    import profile_imports
ImportError: No module named profile_imports

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 588278] [NEW] --profile-imports crashes with ImportError in debian packages

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

Gary van der Merwe wrote:
> Public bug reported:
>
> With bzr 2.1.1 installed from the ubuntu lucid repository:
>
> $ bzr rocks --profile-imports
> Traceback (most recent call last):
> File "/usr/bin/bzr", line 59, in <module>
> import profile_imports
> ImportError: No module named profile_imports
>
> ** Affects: bzr
> Importance: Low
> Status: Confirmed
>
> ** Affects: bzr (Ubuntu)
> Importance: Undecided
> Status: New
>
> ** Also affects: bzr (Ubuntu)
> Importance: Undecided
> Status: New
>

We intentionally don't support it for installed bzr, I'm not sure the
best way to disable it. Potentially just try/except the import failure
and tell them we don't support it.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwFLMwACgkQJdeBCYSNAANmDwCfa/qP3+O2ADWZwrdf8jvQVkln
NSsAoJfXzfMa63ET2B/FS+RB46BFfTaL
=afUQ
-----END PGP SIGNATURE-----

Revision history for this message
Gary van der Merwe (garyvdm) wrote :

On 01/06/10 17:52, John A Meinel wrote:
> We intentionally don't support it for installed bzr

Why? I would like to profile imports on my installed copy.

Revision history for this message
John A Meinel (jameinel) wrote :

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

Gary van der Merwe wrote:
> On 01/06/10 17:52, John A Meinel wrote:
>> We intentionally don't support it for installed bzr
>
> Why? I would like to profile imports on my installed copy.
>

We have the module as a top-level object so that we can import it early
on (before importing any of bzrlib). Otherwise doing "import
bzrlib.profile_imports" would automatically trigger importing bzrlib
which is what we are trying to profile.

As such, it wasn't seen as clean to put 'profile_imports.py' as a
top-level module in the global python namespace. It could be done, but
it doesn't seem particularly beneficial.

I'm not sure what it would take to put it into the installer, I *think*
it would just end up in library.zip which would be fine.

I'm also pretty sure the code is a bit hackish and likely to suffer
across multiple python versions.

Obviously if there is a strong push, we could do something about it. If
you really want that functionality, you could always put
'profile_imports.py' into your PYTHONPATH manually.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwFZu0ACgkQJdeBCYSNAANYaQCguPCcaLFoubtrSebxYqHim+LU
bBwAn2+Y803gtbKyMLPzd3mVlEcAf5Ju
=JtV6
-----END PGP SIGNATURE-----

Revision history for this message
Gary van der Merwe (garyvdm) wrote : Re: --profile-imports crashes with ImportError in debian packages

Ok - I see.

Changed in bzr (Ubuntu):
status: New → Invalid
summary: - --profile-imports crashes with ImportError in debian packages
+ --profile-imports should fail gracefully when not installed
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.