#2098: tgsetup.py fails with AttributeError when .pydistutils.cfg has find_link
value
------------------------+---------------------------------------------------
 Reporter:  aji         |       Owner:  faide                    
     Type:  defect      |      Status:  new                      
 Priority:  normal      |   Milestone:  1.0.x bugfix             
Component:  TurboGears  |     Version:  1.0.8                    
 Severity:  normal      |    Keywords:  tgsetup.py AttributeError
------------------------+---------------------------------------------------
 If my system has a ~/.pydistutils.cfg file with a find_links attribute in
 the [easy_install] section, then tgsetup.py will fail:

 {{{
 $ sudo python tgsetup.py
 TurboGears Installer
 Beginning setuptools/EasyInstall installation and TurboGears download

 Traceback (most recent call last):
   File "tgsetup.py", line 462, in <module>
     tg_main()
   File "tgsetup.py", line 210, in tg_main
     main(args)
   File "tgsetup.py", line 426, in main
     main(argv)
   File "/usr/local/lib/python2.5/site-
 packages/setuptools-0.6c9-py2.5.egg/setuptools/command/easy_install.py",
 line 1671, in main
   File "/usr/local/lib/python2.5/site-
 packages/setuptools-0.6c9-py2.5.egg/setuptools/command/easy_install.py",
 line 1659, in with_ei_usage
   File "/usr/local/lib/python2.5/site-
 packages/setuptools-0.6c9-py2.5.egg/setuptools/command/easy_install.py",
 line 1675, in <lambda>
   File "/usr/lib/python2.5/distutils/core.py", line 151, in setup
     dist.run_commands()
   File "/usr/lib/python2.5/distutils/dist.py", line 974, in run_commands
     self.run_command(cmd)
   File "/usr/lib/python2.5/distutils/dist.py", line 993, in run_command
     cmd_obj.ensure_finalized()
   File "/usr/lib/python2.5/distutils/cmd.py", line 117, in
 ensure_finalized
     self.finalize_options()
   File "tgsetup.py", line 273, in finalize_options
     self.find_links.append(TGDOWNLOAD)
 AttributeError: 'str' object has no attribute 'append'

 }}}

 The existing find_links value is a string, but tgsetup.py assumes that it
 is a list if it exists.

 This patch will fix the error:

 {{{
 $ diff tgsetup.py.orig tgsetup.py
 268a269,272
 >             # this elif fixes the AttributeError: 'str' object has no
 attribute 'append' error
 >             elif isinstance(self.find_links, (str, unicode)):
 >                 # encase string in list
 >                 self.find_links = [self.find_links]
 }}}

-- 
Ticket URL: <http://trac.turbogears.org/ticket/2098>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to