sentry-python icon indicating copy to clipboard operation
sentry-python copied to clipboard

Suppress prompt spawned by subprocess when using pythonw

Open collinbanko opened this issue 4 years ago • 2 comments

On Windows, using pythonw.exe for GUI applications, while determining the release using Git via subprocess a command prompt window is temporarily visible.

This fix updates the subprocess STARTUPINFO dwFlags to use the wShowWindow attribute, which defaults to SW_HIDE hiding the prompt.

collinbanko avatar Apr 09 '21 22:04 collinbanko

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Dec 23 '21 15:12 github-actions[bot]

Here's a one-liner to invoke the subprocess call with pythonw to test for the prompt popup:

pythonw -c 'import sentry_sdk; sentry_sdk.utils.get_default_release()'

Tested on Windows 11, in Windows Terminal, with Git Bash and Command Prompt. (The subprocess popup emitted within a Bash shell is persistent and easier to verify.)

collinbanko avatar Apr 10 '22 23:04 collinbanko

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

getsantry[bot] avatar Oct 18 '23 07:10 getsantry[bot]

I know it has been years @collinbanko but if you bring your branch up to date with our new master and resolve the conflict, than I will merge it immediately! promised!

antonpirker avatar Apr 04 '24 12:04 antonpirker

Oh, nevermind @collinbanko , I figured out how to create a PR that has no conflicts and still has your commits in it: https://github.com/getsentry/sentry-python/pull/2936 Will merge the other one in favor of this one.

Thanks again for the contribution and sorry for the long time it took. Will close this PR and merge the other one.

antonpirker avatar Apr 04 '24 12:04 antonpirker

Thank you for getting this merged in @antonpirker! Better late than never 😄

collinbanko avatar Apr 04 '24 16:04 collinbanko