Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#11098 closed Uncategorized (invalid)

syncdb raising an ImportError when using pyuno

Reported by: dedsm 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


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:

steps to reproduce:
with pyuno installed, and running python's shell with a project environment loaded:

from import call_command
call_command("syncdb", interactive=False)

works perfectly, but:

from import call_command
call_command("syncdb", interactive=False)
import uno
call_command("syncdb", interactive=False)


/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)
    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)
    180     def handle_noargs(self, **options):

/usr/lib64/python2.5/site-packages/django/core/management/commands/ 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

ImportError: type is unknown

Change History (2)

comment:1 Changed 6 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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 Changed 3 years ago by anonymous

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