#11098: syncdb raising an ImportError when using pyuno ---------------------------------------+------------------------------------ Reporter: dedsm | Owner: nobody Status: new | Milestone: Component: Core framework | Version: 1.0 Keywords: syncdb importerror import | Stage: Unreviewed Has_patch: 0 | ---------------------------------------+------------------------------------ When working with django and pyuno (python's connector to openoffice), import uno modifies __import__, and the syncdb function raises ImportError in line 50, can't this verification be done in a more elegant way than checking the string returned? or only checking the word "management"?
libs required to reproduce: pyuno steps to reproduce: with pyuno installed, and running python's shell with a project environment loaded: {{{ from django.core.management import call_command call_command("syncdb", interactive=False) }}} works perfectly, but: {{{ from django.core.management import call_command call_command("syncdb", interactive=False) import uno call_command("syncdb", interactive=False) }}} brings: {{{ /usr/lib64/python2.5/site-packages/django/core/management/__init__.pyc in call_command(name, *args, **options) 156 except KeyError: 157 raise CommandError, "Unknown command: %r" % name --> 158 return klass.execute(*args, **options) 159 160 class LaxOptionParser(OptionParser): /usr/lib64/python2.5/site-packages/django/core/management/base.pyc in execute(self, *args, **options) 94 if self.requires_model_validation: 95 self.validate() ---> 96 output = self.handle(*args, **options) 97 if output: 98 if self.output_transaction: /usr/lib64/python2.5/site-packages/django/core/management/base.pyc in handle(self, *args, **options) 176 if args: 177 raise CommandError("Command doesn't accept any arguments") --> 178 return self.handle_noargs(**options) 179 180 def handle_noargs(self, **options): /usr/lib64/python2.5/site- packages/django/core/management/commands/syncdb.py in handle_noargs(self, **options) 34 for app_name in settings.INSTALLED_APPS: 35 try: ---> 36 __import__(app_name + '.management', {}, {}, ['']) 37 except ImportError, exc: 38 # This is slightly hackish. We want to ignore ImportErrors /usr/lib64/openoffice/basis3.0/program/uno.pyc in _uno_import(name, *optargs) 299 except RuntimeException,e3: 300 # no known uno type ! --> 301 raise ImportError( "type "+ name + "." +x + " is unknown" ) 302 return mod 303 ImportError: type django.contrib.sessions.management. is unknown }}} -- Ticket URL: <http://code.djangoproject.com/ticket/11098> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---