move of bzrlib.util.bencode into bzrlib.bencode breaks bzr-gtk

Bug #385212 reported by GuilhemBichot
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Unassigned
Bazaar GTK+ Frontends
Fix Released
Undecided
Jelmer Vernooij

Bug Description

In revision
4410 revid:<email address hidden>
of bzr.dev, bencode.py moved from bzrlib.util to bzrlib. Thus, code like:
commit.py:from bzrlib.util import bencode
revisionview.py:from bzrlib.util.bencode import bdecode
of bzr-gtk breaks. bzr-gtk needs an update, or bzrlib needs a backward compatibility feature...

Tags: mysql
tags: added: mysql
Revision history for this message
GuilhemBichot (guilhem-bichot) wrote :

I had to do such fix in our MySQL-internal plugin:
-from bzrlib.util import bencode
+try:
+ from bzrlib import bencode
+except ImportError: # bencode was in "util" in the past
+ from bzrlib.util import bencode
because it has to work with pre-rename and post-rename bzr (colleagues may upgrade our plugin without upgrading bzr).
Maybe bzr-gtk needs to do the same?

Jelmer Vernooij (jelmer)
Changed in bzr-gtk:
assignee: nobody → Jelmer Vernooij (jelmer)
status: New → Fix Released
Revision history for this message
GuilhemBichot (guilhem-bichot) wrote :

Hi Jelmer. Probably not a complete fix: after pulling bzr-gtk (revno 644), I still see
./revisionview.py:from bzrlib.util.bencode import bdecode
./tests/test_commit.py:from bzrlib.util import bencode
./tests/test_revisionview.py:from bzrlib.util import bencode
./tests/test_linegraph.py:from bzrlib.util import bencode
For example "bzr gmissing" fails.

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

I did submit: https://code.edge.launchpad.net/~jameinel/bzr/1.16-bencode-compat-385212/+merge/7238

which would at least allow backwards compatibility. It will cause DeprecationWarnings in development versions (those are suppressed in release versions).

Of course, ProgressBarStack has been deprecated since 1.12, and bzr-gtk still used it...

Anyway, changing the imports is the 'correct' thing to do, I just thought I'd mention that likely 1.16 will have backwards compatibility anyway.

Changed in bzr:
importance: Undecided → High
milestone: none → 1.16
status: New → Fix Committed
Revision history for this message
Jonathan Lange (jml) wrote :

Looks like this has landed on trunk already.

Changed in bzr:
status: Fix Committed → Fix Released
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.