Opened 15 years ago

Closed 15 years ago

Last modified 12 years ago

#11098 closed Uncategorized (invalid)

syncdb raising an ImportError when using pyuno

Reported by: David De Sousa Owned by: nobody
Component: Core (Other) Version: 1.0
Severity: Normal Keywords: syncdb importerror import
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Change History (2)

comment:1 by Jacob, 15 years ago

Resolution: invalid
Status: newclosed

This looks like uno is installing some sort of an import hook that's written incorrectly to the point that it causes Django to fail. It's impossible for Django to handle all this sort of monkeypatching, so this is a bug that'll need to be fixed with uno.

comment:2 by anonymous, 12 years ago

Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset
Note: See TracTickets for help on using tickets.
Back to Top