question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Re-spawning with frozen applications

See original GitHub issue

The changes to the re-spawning code work great for calling scripts, but have some side-effects when CherryPy get’s frozen into an .exe where it calls the .exe as if it’s the python interpreter using the parameters it was frozen with. For example: 2016-11-29 22:08:08,905::INFO::[_cplogging:219] [29/Nov/2016:22:08:08] ENGINE Re-spawning C:\Users\xxx\Documents\GitHub\SABnzbd-1.2.x2-win32-bin\SABnzbd-1.2.x2\SABnzbd-console.exe -E -OO -S C:\Users\xxx\Documents\GitHub\SABnzbd-1.2.x2-win32-bin\SABnzbd-1.2.x2\SABnzbd-console.exe Our current release uses CherryPy 6.0.2 which only included sys.argv.

Simple solution: check if it’s a frozen app and then don’t include the interpreter flags.

        try:
            args = self._get_true_argv()
        except NotImplementedError:
            """It's probably win32"""
            if getattr(sys, 'frozen', False):
                args = [sys.executable] + sys.argv
            else:
                args = [sys.executable] + _args_from_interpreter_flags() + sys.argv

I currently can’t check how this would work on macOS when it gets frozen into an App. Since macOS does have the self._get_true_argv() I am not sure what will happen but I imagine a similar thing.

  1. AFAIK these tools like py2exe never worked really well

They actually work quite well, we have 100.000+ happy users on Windows/macOS that don’t have to bother with command line things and get our app with CherryPy setup with just a few clicks 😊

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
webknjazcommented, Nov 30, 2016

@Safihre thanks for the investigation and the link you provided. I’ll look into this later, meanwhile feel free to submit a PR. If this fix is all we need I’d move it to the beginning of _args_from_interpreter_flags():

if getattr(sys, 'frozen', False):
    return ()

On the other hand, we need to check whether there’s an option/need of surviving command line args. Also I’ll need your help with testing this against other OSes. TIA.

0reactions
webknjazcommented, Dec 1, 2016

@Safihre I’m marking this as closed, feel free to re-open this issue or file a new one if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Applications Freezing - Apple Community
An odd problem that has recently appeared is applications freezing for up to a ... such as respawning in a game, tab-ing between...
Read more >
mw2 freezing on respawn : r/modernwarfare2 - Reddit
I'm hoping it's a mw2 issue and not ps5, when mine freezes ps5 isn't ... and i can close application but can't do...
Read more >
[MC-91636] Ender dragon spawn sequence freezes when you ...
Spawn a new dragon using end crystals; Quit the world in the spawning process of the ender dragon and rejoin the world.
Read more >
Freeze upon spawning in any vehicle - War Thunder Forums
... my game instantly freezes up after it spawns into the game. ... states "Blocked Application aces.exe from using graphics interface".
Read more >
Node-cli freeze after Spawning a child_process - Stack Overflow
UPDATED ANSWER: I trimmed down your spawner a little in order to be succinct, and eliminate any other possibilities.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found