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

Stdin warning makes programs stuck #1349

Closed
isidentical opened this issue Apr 10, 2022 · 4 comments · Fixed by #1350
Closed

Stdin warning makes programs stuck #1349

isidentical opened this issue Apr 10, 2022 · 4 comments · Fixed by #1350
Labels
bug Something isn't working

Comments

@isidentical
Copy link
Contributor

Context: https://discord.com/channels/725351238698270761/799982808122523648/962805007248392192

@NachoSoto
Copy link

NachoSoto commented Apr 15, 2022

httpie has stopped working for me, even after this fix (I installed it with brew install --HEAD httpie).

Example request:

http -v --debug google.com
HTTPie 3.1.1.dev0
Requests 2.27.1
Pygments 2.11.2
Python 3.10.2 (main, Feb  2 2022, 05:51:25) [Clang 13.0.0 (clang-1300.0.29.3)]
/opt/homebrew/Cellar/httpie/HEAD-83803db/libexec/bin/python3.10
Darwin 21.4.0

<Environment {'apply_warnings_filter': <function Environment.apply_warnings_filter at 0x106332b90>,
 'args': Namespace(),
 'as_silent': <function Environment.as_silent at 0x106332a70>,
 'colors': 8,
 'config': {'__meta__': {'about': 'HTTPie configuration file',
                         'help': 'https://httpie.org/doc#config',
                         'httpie': '1.0.3'},
            'default_options': []},
 'config_dir': PosixPath('/Users/nachosoto/.httpie'),
 'devnull': <property object at 0x10630e9d0>,
 'is_windows': False,
 'log_error': <function Environment.log_error at 0x106332b00>,
 'program_name': 'http',
 'quiet': 0,
 'rich_console': <functools.cached_property object at 0x106325db0>,
 'rich_error_console': <functools.cached_property object at 0x106325120>,
 'show_displays': True,
 'stderr': <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>,
 'stderr_isatty': True,
 'stdin': <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>,
 'stdin_encoding': 'utf-8',
 'stdin_isatty': True,
 'stdout': <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>,
 'stdout_encoding': 'utf-8',
 'stdout_isatty': True}>

<PluginManager {'adapters': [],
 'auth': [<class 'httpie.plugins.builtin.BasicAuthPlugin'>,
          <class 'httpie.plugins.builtin.DigestAuthPlugin'>,
          <class 'httpie.plugins.builtin.BearerAuthPlugin'>],
 'converters': [],
 'formatters': [<class 'httpie.output.formatters.headers.HeadersFormatter'>,
                <class 'httpie.output.formatters.json.JSONFormatter'>,
                <class 'httpie.output.formatters.xml.XMLFormatter'>,
                <class 'httpie.output.formatters.colors.ColorFormatter'>]}>

>>> requests.request(**{'auth': None,
 'data': RequestJSONDataDict(),
 'headers': <HTTPHeadersDict('User-Agent': b'HTTPie/3.1.1.dev0')>,
 'method': 'get',
 'params': <generator object MultiValueOrderedDict.items at 0x1065d6260>,
 'url': 'http://google.com'})

GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: google.com
User-Agent: HTTPie/3.1.1.dev0

Nothing prints after that, it's just stuck. Debugging the request it looks like it receives a 301, but it's not processing the redirect.

@isidentical
Copy link
Contributor Author

httpie has stopped working for me, even after this fix (I installed it with brew install --HEAD httpie).

Hey @NachoSoto thanks for the report! I can't seem to reproduce your issue (on a fresh environment). When did you start experiencing these problems? (it seems like your issue is irrelevant from this by the way, as this issue was for POST/PUT etc. that was originating from stdin).

@NachoSoto
Copy link

Sorry you're right! This was an unrelated issue caused by a local proxy.

@isidentical
Copy link
Contributor Author

For future reference, you might want to specify --timeout=30 (or something like that) in your ~/.config/httpie/config.json so that it won't make you want indefinietely and let you know about the potential issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants