Thread: [Harmattan Maemo6] [ANNOUNCE] MeeShop - new app store
View Single Post
Posts: 252 | Thanked: 282 times | Joined on Oct 2021 @ Poland
#6
I can't fix one thing. Usually, when I install any app using my program, right after it finishes installing app Terminal window closes. Here is my code:

Code:
try:
    subprocess.check_call(f"LANG=C aegis-apt-get install -y --force-yes {package}", shell=True)
except PermissionError:
    print(f"{red} A problem with file permissions.{reset}")
    press_enter()
    return
except FileNotFoundError:
    print(f"{red} File not found.{reset}")
    press_enter()
    return
except subprocess.CalledProcessError:
    print(" Some error occured...")
    press_enter()
    return
and following code runs it:

Code:
try:
    apt.install(package)
except Exception as e:
    print(f" Error {red}{e}{reset}! Report to developer.")
    input(f"{blink}{cyan} Press Enter to exit... {reset}")
I can't understand why this happens. I carefully checked everything, changed subprocess.run without shell=True to subprocess.check_call and subprocess.call, added all try-except checks. It looks like it overloads memory or whatever? But why? It doesn't happen in any other scenario. Looks like subprocess causes that, but why. Maybe using old bad os.system will help? I must try.
__________________
My Telegram group (Maemo / MeeGo / Sailfish):
https://t.me/linuxmobile_world
Channel for Maemo/MeeGo:
https://t.me/maemomeegoapps