Comments (7)
My suggested fix is missing a "if tostdout:" before printing to stdout.
if tostdout:
sys.stdout.write(stdout.decode('utf-8'))
sys.stdout.flush()
from pygitup.
Hey, thanks for reporting! That's an interesting edge case. I'll need a couple more details to look into this. Which version of Python are you using? Also, how exactly does the deadlock play out? Does PyGitUp just hang forever? Is there any output before the deadlock happens?
from pygitup.
from pygitup.
So I've thought a little about how we can solve this. It appears to me we have the following options:
- Increase the buffer size. This is only a band-aid really, as we don't know beforehand how much stderr output there will be.
- The solution you proposed seems to just wait for the subprocess to finish and then process
stdout
andstderr
. This avoids the buffer problem but it also means we print the contentsstdout
after the subprocess finished instead of printing it live. Right now, we only needstdout
printing forgit fetch
. So we could probably have a special implementation that does live output the way we do it now. This implementation then would only be used forgit fetch
where we probably won't run into buffering problems. - A more general solution would be to move
stderr
processing off to a separate thread (using something like this: http://stackoverflow.com/a/31867499/997063). This would be the most clean solution but would introduce multithreading as a potential source of problems. And I guess it may be just plain overkill.
What are your thoughts on this?
from pygitup.
from pygitup.
I've implemented a fix for the deadlock problem following option 2 I outlined earlier. In theory it may still deadlock when running git fetch
but I doubt this command will be able to fill the buffer (default is 8 KB) with error messages.
Do you still have the repository that used to cause the deadlock? If so, could you verify the fix works? Of course you'd have to install PyGitUp from the latest master
first.
from pygitup.
Closing due to inactivity, feel free to re-open if this is still an issue.
from pygitup.
Related Issues (20)
- Does not seem to rebase current branch with Master HOT 2
- git-up parsing remotes from .git/config incorrectly HOT 3
- Compatibility problem with Python 3.9? HOT 16
- Please consider relaxing the release restriction on colorama HOT 1
- `git up` should probably obey `pull.ff-only = true` and maybe even `branch.BR.mergeOptions` too
- stderr: 'fatal: no such remote or remote group: https: HOT 2
- `git up` Fetching origin interrupted emits backtrace HOT 3
- If using Python 3 and run from within SourceTree Custom Actions, throws "RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment." HOT 8
- Add option to update submodules as well HOT 1
- stderr: '.git/rebase-apply/patch:1153: new blank line at EOF. HOT 2
- Crash under cygwin with configured git-up.rebase.log-hook HOT 1
- Fast-forward without checking out the branch HOT 4
- Incompatible with Click 7.0.0, should restrict dependency to <7.0.0 HOT 1
- Only stash changes if it's actually needed HOT 3
- git: 'up' is not a git command. HOT 3
- How to install using `--user` option? HOT 4
- `git up` doesn't seem to mention the currently checked out branch unless it appears in a `branch` entry HOT 4
- Re-enable code coverage uploading HOT 1
- FYI - Intent to package for Fedora HOT 1
- git-up will not fast-forward with git > 2.26 when using rebase HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygitup.