Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yamlfixer hangs on Git bash #43

Open
adriens opened this issue Mar 17, 2022 · 19 comments
Open

Yamlfixer hangs on Git bash #43

adriens opened this issue Mar 17, 2022 · 19 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation RUN

Comments

@adriens
Copy link
Member

adriens commented Mar 17, 2022

image

@adriens adriens added bug Something isn't working documentation Improvements or additions to documentation labels Mar 17, 2022
@tamere-allo-peter
Copy link
Member

tamere-allo-peter commented Mar 17, 2022

Looks like a bug in git bash for me. If yamlfixer hangs its probably because it tries to read input from stdin, and it only does this if :

  • either - is specified as a filename on the command line, which is not the case here
  • or stdin is not a TTY, i.e. stdin is a pipe, which should not be the case here, unless git bash is broken.

@tamere-allo-peter
Copy link
Member

@adriens : if pressing Ctrl+D cleanly interrupts yamlfixer's hanging, see case 2 above.

@adriens
Copy link
Member Author

adriens commented Mar 17, 2022

if pressing Ctrl+D cleanly interrupts yamlfixer's hanging, see case 2 above.

It does not interrupt, even not ^C

@tamere-allo-peter
Copy link
Member

Strange... Could you launch again with --debug then ?

@adriens
Copy link
Member Author

adriens commented Mar 17, 2022

image

@tamere-allo-peter
Copy link
Member

tamere-allo-peter commented Mar 17, 2022

That's what I said : you shell is buggy. In the code there's this :

# Ensure we read from stdin in case it's redirected
if ("-" not in sys.argv[1:]) and not sys.stdin.isatty():
    sys.argv.append("-")

This condition should not be met, but it is, hence there's probably a bug in your shell.

@tamere-allo-peter
Copy link
Member

@adriens could you paste the result of this on your git bash shell :

jerome@OPT17844:~$ python3
Python 3.8.10 (default, Nov 26 2021, 20:14:08) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.stdin.isatty()
True
>>> 

@adriens
Copy link
Member Author

adriens commented Mar 17, 2022

I'll provide yo uthat this afternoon 👍

@adriens
Copy link
Member Author

adriens commented Mar 17, 2022

image

@tamere-allo-peter
Copy link
Member

This sucks...

@adriens
Copy link
Member Author

adriens commented Mar 17, 2022

Sure 💩 💋

@tamere-allo-peter
Copy link
Member

Big time !

@adriens
Copy link
Member Author

adriens commented Mar 17, 2022

Legendary 💣

@tamere-allo-peter
Copy link
Member

@adriens Not a bug in yamlfixer for sure, please see git-for-windows/git#2594

I'll keep this one open though, because there's a similar issue when run from a GitHub action and I'm working on this atm.

@tamere-allo-peter
Copy link
Member

@adriens here's a workaround for you : https://jpcodeqa.com/q/37d31f92ab77ec9de6be7e217da60985

@adriens
Copy link
Member Author

adriens commented Mar 24, 2022

there's a similar issue when run from a GitHub action and I'm working on this atm.

in a way that's a good news you could reproduce it 🤞

@adriens
Copy link
Member Author

adriens commented Mar 24, 2022

@mbarre pour Dockerfile, les variables à positionner

cf ~/yamlfixer/blob/main/yamlfixer/__main__.py

  and not os.environ.get("GITHUB_ACTIONS")
  and not os.environ.get("CI"):

exposer les variables dans Dockerfile et les positionner à true

@mbarre
Copy link
Collaborator

mbarre commented Mar 24, 2022

Yep, je viens d'ajouter GITHUB_ACTIONS, publication de l'image docker en cours

@adriens
Copy link
Member Author

adriens commented Mar 24, 2022

cf

and not os.environ.get("GITHUB_ACTIONS") \

@adriens adriens added the RUN label Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation RUN
Projects
None yet
Development

No branches or pull requests

3 participants