'./setup.py build' results in AttributeError: 'NoneType' object has no attribute 'append'

Bug #493978 reported by Markus Korn on 2009-12-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-distutils-extra (Ubuntu)
Undecided
Markus Korn

Bug Description

Binary package hint: python-distutils-extra

I get this when running the attached setup.py:

% ./setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.6
copying src/fusepy.py -> build/lib.linux-x86_64-2.6
creating build/lib.linux-x86_64-2.6/zeitgeistfs
copying src/zeitgeistfs/fselements.py -> build/lib.linux-x86_64-2.6/zeitgeistfs
copying src/zeitgeistfs/desktopfile.py -> build/lib.linux-x86_64-2.6/zeitgeistfs
copying src/zeitgeistfs/utils.py -> build/lib.linux-x86_64-2.6/zeitgeistfs
copying src/zeitgeistfs/cmd.py -> build/lib.linux-x86_64-2.6/zeitgeistfs
copying src/zeitgeistfs/filesystem.py -> build/lib.linux-x86_64-2.6/zeitgeistfs
copying src/zeitgeistfs/__init__.py -> build/lib.linux-x86_64-2.6/zeitgeistfs
running build_i18n
intltool-update -p -g zeitgeist-filesystem
msgfmt po/zeitgeist-filesystem-de.po -o build/mo/zeitgeist-filesystem-de/LC_MESSAGES/zeitgeist-filesystem.mo
Traceback (most recent call last):
  File "./setup.py", line 60, in <module>
    "build_i18n" : build_i18n.build_i18n
  File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.6/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.6/dist-packages/DistUtilsExtra/command/build_i18n.py", line 100, in run
    data_files.append((targetpath, (mo_file,)))
AttributeError: 'NoneType' object has no attribute 'append'

ProblemType: Bug
Architecture: amd64
Date: Tue Dec 8 10:58:41 2009
DistroRelease: Ubuntu 9.10
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Alpha amd64 (20091009)
NonfreeKernelModules: nvidia
Package: python-distutils-extra 2.12
PackageArchitecture: all
ProcEnviron:
 LANG=de_DE.UTF-8
 SHELL=/bin/zsh
ProcVersionSignature: Ubuntu 2.6.31-16.52-generic
SourcePackage: python-distutils-extra
Uname: Linux 2.6.31-16-generic x86_64

Markus Korn (thekorn) wrote :
Markus Korn (thekorn) wrote :

After looking at the source it looks like it failed because I did not define anything for data_files in setup.py, this is why self.distribution.data_files defaults to None.
The fix for this is to use an empty list instead of None in build_i18n.run() in such cases, I'm working on a patch now.

Changed in python-distutils-extra (Ubuntu):
status: New → In Progress
assignee: nobody → Markus Korn (thekorn)
Markus Korn (thekorn) wrote :

Fixed in the attached branch,
------------------------------------------------------------
revno: 10
committer: Markus Korn <email address hidden>
branch nick: python-distutils-extra
timestamp: Tue 2009-12-08 11:20:19 +0100
message:
  * using an empty list for data_files in build_i18n.run() if data_files s not
    defined to fix (LP: #493978)
------------------------------------------------------------

Martin Pitt (pitti) wrote :

trunk r148, thank you!

Changed in python-distutils-extra (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-distutils-extra - 2.14

---------------
python-distutils-extra (2.14) unstable; urgency=low

  * Bump Standards-Version to 3.8.3 (no changes necessary).
  * build_i18n.py: Fix crash when setup.py defines no data files. Thanks to
    Markus Korn! (LP: #493978)
  * auto.py: Preserve symlinks in bin/ and data/. distutils copies them as
    files by default, so we have to write the complete handling for those
    ourselves. (LP: #392562)
 -- Martin Pitt <email address hidden> Tue, 22 Dec 2009 23:47:46 +0100

Changed in python-distutils-extra (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers