exceptions.NameError: global name 'self' is not defined

Bug #339333 reported by Martin Pitt
2
Affects Status Importance Assigned to Milestone
bzr-builddeb (Ubuntu)
Fix Released
Undecided
James Westby

Bug Description

Binary package hint: bzr-builddeb

I read about bd's ability to build directly from remote branches, so I wanted to give this a shot:

$ bzr bd lp:usplash
/usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb/import_dsc.py:33: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import md5
/usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb/repack_tarball.py:26: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import sha
Building branch from revision <email address hidden>
Looking for a way to retrieve the upstream tarball
Using apt to look for the upstream tarball.
bzr: ERROR: exceptions.NameError: global name 'self' is not defined

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 896, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 842, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 542, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb/cmds.py", line 393, in run
    builder.export()
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb/builder.py", line 74, in export
    self.distiller.distill(self.target_dir)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb/source_distiller.py", line 82, in distill
    self._distill(target)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb/source_distiller.py", line 107, in _distill
    self.upstream_provider.provide(parent_dir)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb/upstream.py", line 204, in provide
    elif self.provide_with_apt(self.store_dir):
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb/upstream.py", line 237, in provide_with_apt
    target_dir)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb/upstream.py", line 47, in provide_with_apt
    (self.package, sources.Version)
NameError: global name 'self' is not defined

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
Package: bzr-builddeb 2.1ubuntu1
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: bzr-builddeb
Uname: Linux 2.6.28-8-generic i686

Revision history for this message
Martin Pitt (pitti) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

The same happens in a local tree if there is no ../foo.orig.tar.gz.

Revision history for this message
Martin Pitt (pitti) wrote :

This is easily fixed by removing the erroneous "self." before the package in line 47.

Changed in bzr-builddeb:
status: New → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

Unfortunately ubuntu-core-dev cannot commit to the branch, otherwise I'd just fix it myself.

Revision history for this message
James Westby (james-w) wrote :

Hi,

Sorry about this, it's already fixed in my branch, just needs an
upload.

Thanks,

James

Changed in bzr-builddeb:
assignee: nobody → james-w
status: Triaged → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 339333] Re: exceptions.NameError: global name 'self' is not defined

James Westby [2009-03-07 23:41 -0000]:
> Sorry about this, it's already fixed in my branch, just needs an
> upload.

Need a sponsor for Debian? I can do that, and you can sync it over
later.

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 339333] Re: exceptions.NameError: global name 'self' is not defined

On Sun, 2009-03-08 at 00:02 +0000, Martin Pitt wrote:
> James Westby [2009-03-07 23:41 -0000]:
> > Sorry about this, it's already fixed in my branch, just needs an
> > upload.
>
> Need a sponsor for Debian? I can do that, and you can sync it over
> later.

That would be great, I planned to do a couple of hours testing and
bug-fixing on it today, so I'll prepare an upload after that, which
will be tomorrow your time, if that's ok.

Thanks,

James

Revision history for this message
James Westby (james-w) wrote :

Hi Martin,

If you could upload the tip of lp:~james-w/bzr-builddeb/2.1/ to
experimental I would be very grateful.

Thanks,

James

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 339333] Re: exceptions.NameError: global name 'self' is not defined

Hello James,
James Westby [2009-03-08 7:37 -0000]:
> If you could upload the tip of lp:~james-w/bzr-builddeb/2.1/ to
> experimental I would be very grateful.

Done. Thanks for the fixes!

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

This bug was fixed in the package bzr-builddeb - 2.1.1

---------------
bzr-builddeb (2.1.1) experimental; urgency=low

  * Make get-orig-source priority higher than uscan. Thanks Martin Pitt.
    (LP: #339343).
  * Correct variable used in provide_with_apt. Thanks also to Martin Pitt.
    (LP: #339333)
  * Use hashlib instead of the sha and md5 modules. Thanks Kees Cook.
    (LP: #338525)

 -- James Westby <email address hidden> Mon, 16 Mar 2009 00:55:03 +0000

Changed in bzr-builddeb:
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.