Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
292 views
in Technique[技术] by (71.8m points)

python - Clash between Kivy and PyUpdater Logges

I am Using PyUpdater to Auto Update my kivy app. I am stuck at a situation where my app get crashed (after so many warnings in terminal window) when I import pyupdater's Client class (in my app).

What I know from different sources that (May be I am wrong), it happens due to clash between pyupdater and kivy to get logger (as pyupdater try to get root logger). How can I resolve this issue ? Any help would be highly appreciable.

Note: The app works Ok, if I import pyupdater before kivy. But I want to import pyupdater in another file.

A snapshot of Warnings is attached below: enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Kivy does (sadly) also take/set the root logger, we hope to change that, but we have to evaluate if that would cause issues.

If you can still import PyUpdater as long as you import it before Kivy, then you can decide to import it in your main module (before kivy), even if you don't use it there, as python modules are singletons (importing them in another place of the same running program gives you access to the same namespace, that is global to the application), that would allow you to import it safely later in another module.

import pyupdater # noqa
import kivy
...

in another module

import pyupdater

should now work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...