[Distutils] Setuptools bug with tag_svn_revision

Philip Jenvey pjenvey at groovie.org
Wed Jun 13 23:13:58 CEST 2007


On Jun 5, 2007, at 10:35 AM, Ian Bicking wrote:

> If you try to do egg_info in a package that is in svn, but where any
> directory or subdirectory in the package has been added but not
> committed to svn, you'll get this error:
>
> Traceback (most recent call last):
>    File "setup.py", line 25, in ?
>      entry_points="""
>    File "distutils/core.py", line 149, in setup
>    File "/usr/lib/python2.4/distutils/dist.py", line 946, in  
> run_commands
>      self.run_command(cmd)
>    File "/usr/lib/python2.4/distutils/dist.py", line 965, in  
> run_command
>      cmd_obj.ensure_finalized()
>    File "/usr/lib/python2.4/cmd.py", line 117, in ensure_finalized
>      pass
>    File
> "/home/ianb/env/webdev/lib/python2.4/setuptools-0.6c6-py2.4.egg/ 
> setuptools/command/egg_info.py",
> line 85, in finalize_options
>      self.vtags = self.tags()
>    File
> "/home/ianb/env/webdev/lib/python2.4/setuptools-0.6c6-py2.4.egg/ 
> setuptools/command/egg_info.py",
> line 179, in tags
>      ):  version += '-r%s' % self.get_svn_revision()
>    File
> "/home/ianb/env/webdev/lib/python2.4/setuptools-0.6c6-py2.4.egg/ 
> setuptools/command/egg_info.py",
> line 227, in get_svn_revision
>      localrev = max([int(m.group(1)) for m in revre.finditer(data)])
> ValueError: max() arg is an empty sequence

I've also ran into this under the same circumstances (with an svn  
add'ed directory), however it manifested on line 224:

   File "/usr/local/lib/python2.4/site-packages/setuptools-0.6c6- 
py2.4.egg/setuptools/command/egg_info.py", line 179, in tags
     ):  version += '-r%s' % self.get_svn_revision()
   File "/usr/local/lib/python2.4/site-packages/setuptools-0.6c6- 
py2.4.egg/setuptools/command/egg_info.py", line 224, in get_svn_revision
     localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]])
ValueError: max() arg is an empty sequence
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
 > /usr/local/lib/python2.4/site-packages/setuptools-0.6c6-py2.4.egg/ 
setuptools/command/egg_info.py(224)get_svn_revision()
-> localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]])
(Pdb) p data
[['', 'dir', '0', 'http://svn.makotemplates.org/mako/trunk/test/ 
templates', 'http://svn.makotemplates.org', 'add', '', '', '', '',  
'', '', '', 'svn:special svn:externals svn:needs-lock'],  
['l10n.mako', 'file', '', '', '', 'add'], []]
(Pdb) [int(d[9]) for d in data if len(d)>9 and d[9]]
[]

--
Philip Jenvey




More information about the Distutils-SIG mailing list