GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Avoid spawning console windows when running from .pyw by boppreh · Pull Request #126 · gitpython-developers/GitPython

Conversation

@boppreh

@boppreh boppreh commented Oct 18, 2013

Copy link
Copy Markdown
Contributor

I'm developing a small background application (Windows + PyQt) to track Git repositories.

The GitPython module works great, but when called from a windowless script (.pyw) each command spawns a console window. Those windows are empty and last only a second, but I think they should not be there at all.

I saw it was using Popen to call the git executable and added a shell=True parameter to avoid spawning those windows.

Be aware I haven't tested this on other machines or operating systems.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@boppreh
Avoid spawning console windows when running from .pyw
3f277ba
By adding `shell=True,` to the list of Popen parameters, we avoid spawning console windows when scripts call this method from a windowless (.pyw) Python script.
@Byron
Byron merged commit 3f277ba into gitpython-developers:0.3 Nov 17, 2014
@Byron

Byron commented Nov 17, 2014

Copy link
Copy Markdown
Member

I didn't test it on windows either, but made sure a shell is only enforced on windows now.
This could be an issue, as I don't remember having experienced this popup issue back in the days when testing on windows.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Byron Byron added this to the v0.3.3 milestone Nov 17, 2014
Byron added a commit that referenced this pull request Apr 8, 2015
@Byron
fix(cmd): throw GitCommandNotFoundError ...
1c2dd54
... if it is not found. Previously, especially on windows, this wasn't
explicit.

Fixes #248, affects #126
@Byron

Byron commented Apr 8, 2015

Copy link
Copy Markdown
Member

Please note that with the release of v0.3.7, you will need to to set git.Git.USE_SHELL=True to get back to the same behaviour.
See related issue #248 for more information.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@EliahKagan EliahKagan mentioned this pull request Oct 2, 2023
Git.execute treats shell=False the same as shell=None #1685
Closed
@EliahKagan EliahKagan mentioned this pull request Dec 22, 2023
USE_SHELL = True not needed since 2.0.8 but still suggested for Windows #1781
Closed
@EliahKagan EliahKagan mentioned this pull request Jan 16, 2024
Fix two remaining Windows untrusted search path cases #1792
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

v0.3.3

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@boppreh @Byron
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.