Python uno. '' object has no attribute 'requestRestart'

Hi all. I need to restart office after changing UI language (so as real application behaves). So I found XRestartManager (Interface XRestartManager) which has requestRestart method I wanted to try.

But, when I run following code:

            import uno
            restart_manager = uno.getClass("")()

I have got

AttributeError: '' object has no attribute 'requestRestart'

Maybe there are some another way to perform app restart. Any advices might be helpfull.
Thank you!

Use the component context to get the singleton.

ctx = XSCRIPTCONTEXT.getComponentContext()
restartManager = ctx.getValueByName(
if not restartManager.isRestartRequested(False):

According to [Solved] Auto update extension (View topic) • Apache OpenOffice Community Forum, it didn’t use to restart. But it works now, so the full implementation must have been added at some point.

Thank you, OfficeRestartManager instantiated and worked properly in this way.


Hi, looking to call a restart from a base form after user completes an input box. Not familiar with Python, how can I do this with a basic macro ?
Thanks for your thoughts

@gkick: See How do I create an instance of a singleton? - #6 by librebel

Thanks for the link

It doesn’t work for me. StarBasic code:

ctx = GetDefaultContext()
restartManager = ctx _
If Not restartManager.isRestartRequested(False) Then
    restartManager.requestRestart(None)  'triggers an error (see screenshot)
End If

Снимок экрана от 2021-07-11 16-33-43.png