Package: sqlobject
Severity: normal

Hello,

I'm packaging TurboGears, and while trying to make it run with
SQLObject 0.7.0 I hit the following problem:

Traceback (most recent call last):
  File "/usr/bin/tg-admin", line 7, in ?
    sys.exit(
  File "/var/lib/python-support/python2.4/turbogears/command/base.py", line 
275, in main
    command.run()
  File "/var/lib/python-support/python2.4/turbogears/command/base.py", line 
134, in run
    command.the_runner.run(sys.argv)
  File "/usr/lib/python2.4/site-packages/sqlobject/manager/command.py", line 
101, in run
    runner.run()
  File "/usr/lib/python2.4/site-packages/sqlobject/manager/command.py", line 
231, in run
    self.load_options_from_egg(egg_spec)
  File "/usr/lib/python2.4/site-packages/sqlobject/manager/command.py", line 
414, in load_options_from_egg
    dist, conf = self.config_from_egg(egg_spec)
  File "/usr/lib/python2.4/site-packages/sqlobject/manager/command.py", line 
426, in config_from_egg
    dist = pkg_resources.working_set.find(pkg_resources.Requirement(egg_spec))
TypeError: __init__() takes exactly 4 arguments (2 given)

The __init__ method for Requirement apparently is undocumented has an
unstable API. It recommends using the parse method:

 |  __init__(self, project_name, specs, extras)
 |      DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!

The attached patch does just that.

Thanks!

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-1-686
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)
--- sqlobject/manager/command.py~	2006-06-27 19:19:54.000000000 -0300
+++ sqlobject/manager/command.py	2006-06-27 19:20:36.000000000 -0300
@@ -422,7 +422,7 @@
     def config_from_egg(self, egg_spec, warn_no_sqlobject=True):
         import pkg_resources
         pkg_resources.require(egg_spec)
-        dist = pkg_resources.working_set.find(pkg_resources.Requirement(egg_spec))
+        dist = pkg_resources.working_set.find(pkg_resources.Requirement.parse(egg_spec))
         if not dist.has_metadata('sqlobject.txt'):
             if warn_no_sqlobject:
                 print 'No sqlobject.txt in %s egg info' % egg_spec

Reply via email to