You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to debug an application I wrote that's using Fabric. It used to work until today and can't remember what changed. I'm not sure my problem is caused solely by Fabric but I think Fabric contributes.
When running my application in PyCharm using its debugger, the application hangs on
from fabric.operations import sudo
I stepped through the import and ultimately it is the Popen in versions.git_sha() that hangs. I don't know why, but the debugger follows the child of the fork() that's done in Popen. I don't know what the debugger does on the parent process.
I'm fairly new to Python, but I find it rather unorthodox ;-) that Fabric runs a shell command during an import. The intention seems to be to get the current git commit for rendering the version string. However, I installed my Python using Homebrew for Mac OS X which means that all installed Python packages are underneath Homebrew's top-level git working copy. This means that the git log command run by git_sha uses Homebrews log, not Fabric's.
Can we add a check for a .git directory before running git log?
The text was updated successfully, but these errors were encountered:
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python /Applications/PyCharm.app/helpers/pydev/pydevd.py --multiproc --client 127.0.0.1 --port 54636 --file /usr/local/bin/fab host_type
pydev debugger: process 33647 is connecting
Connected to pydev debugger (build 129.314)
No hosts found. Please specify (single) host string for connection: localhost
[localhost] sudo: uname -v
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/getpass.py:83: GetPassWarning: Can not control echo on the terminal.
passwd = fallback_getpass(prompt, stream)
Warning: Password input may be echoed.
[localhost] Passphrase for private key: secret
[localhost] out: Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64
It's worth noting that in the past PyCharm's debugger was not always good at handling user input scenarios (and still is lacking when it comes to getpass). Maybe you can update this issue with your fabric, python, and PyCharm version?
I installed fabric via pip. Maybe try that? That should narrow down whether this issue is with fabric itself or how it was installed.
I agree that using the git SHA version junk is suboptimal when it causes issues like this, though it also doesn't come up often, and it sounds like there are workarounds re: Pycharm's triggering behavior, as per @berimor.
That said, clearly it affects multiple people, I've abandoned this sort of "super rich versioning" for newer projects, and it never proved as useful in troubleshooting as I had hoped (most users on real git checkouts are savvy enough to provide the SHA themselves or to submit it on request). So I might just consider it a bug and rip it out.