question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Internationalized domain names are not supported on Windows

See original GitHub issue

See https://en.wikipedia.org/wiki/Internationalized_domain_name for explanation of IDN URLs.

http --debug POST 115.бел

The command above fails, because arguments are not read with Unicode Windows API - https://stackoverflow.com/questions/846850/read-unicode-characters-from-command-line-arguments-in-python-2-x-on-windows/846931#846931

HTTPie 0.9.9
Requests 2.13.0
Pygments 2.1.3
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)]
c:\python27\python.exe
Windows Vista

<Environment {
    "colors": 256, 
    "config": {
        "__meta__": {
            "about": "u'HTTPie configuration file'", 
            "help": "u'https://httpie.org/docs#config'", 
            "httpie": "u'0.9.9'"
        }, 
        "default_options": "[]"
    }, 
    "config_dir": "C:\\Users\\user\\AppData\\Roaming\\\\httpie", 
    "is_windows": true, 
    "stderr": "<colorama.ansitowin32.StreamWrapper object at 0x02F65670>", 
    "stderr_isatty": false, 
    "stdin": "<open file '<stdin>', mode 'r' at 0x018BD020>", 
    "stdin_encoding": "cp437", 
    "stdin_isatty": true, 
    "stdout": "<colorama.ansitowin32.StreamWrapper object at 0x02F65530>", 
    "stdout_encoding": "cp437", 
    "stdout_isatty": true
}>

>>> requests.request(**{
    "allow_redirects": false, 
    "auth": "None", 
    "cert": "None", 
    "data": {}, 
    "files": {}, 
    "headers": {
        "User-Agent": "HTTPie/0.9.9"
    }, 
    "method": "u'post'", 
    "params": {}, 
    "proxies": {}, 
    "stream": true, 
    "timeout": 30, 
    "url": "u'http://115.???'", 
    "verify": true
})


http: error: ConnectionError: HTTPConnectionPool(host='115.', port=80): Max retries exceeded with url: /??? (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x0305BDF0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)) while doing POST request to URL: http://115./???
Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\http.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\httpie\__main__.py", line 11, in main
    sys.exit(main())
  File "c:\python27\lib\site-packages\httpie\core.py", line 227, in main
    log_error=log_error,
  File "c:\python27\lib\site-packages\httpie\core.py", line 99, in program
    final_response = get_response(args, config_dir=env.config.directory)
  File "c:\python27\lib\site-packages\httpie\client.py", line 70, in get_response
    response = requests_session.request(**kwargs)
  File "c:\python27\lib\site-packages\requests\sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\python27\lib\site-packages\requests\sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "c:\python27\lib\site-packages\requests\adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='115.', port=80): Max retries exceeded with url: /??? (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x0305BDF0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
techtonikcommented, Jun 25, 2020

Python 2 is not supported by httpie and Windows is no longer supported by me. =)

0reactions
techtonikcommented, Apr 1, 2017

argparse is not guilty - I just passed wrong parameter to main. #573 now contain correct fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling Internationalized Domain Names (IDNs) - Win32 apps
This topic describes how you can work with internationalized domain names (IDNs) in your applications. IDNs are specified by Network Working ...
Read more >
If your domain name parser can't handle internationalized ...
Suppose my web site filters domain names, say with the following test: ... But the bug is not in the web browser.
Read more >
IDN internationa domain names not working - MSDN - Microsoft
Hi,. I've just got request from some of my customers to add few IDN domains, which include special characters. But WSP does not...
Read more >
IdnToAscii function (winnls.h) - Win32 apps - Microsoft Learn
Converts an internationalized domain name (IDN) or another internationalized label to a Unicode (wide character) representation of the ASCII ...
Read more >
Outlook cannot connect to SMTP server due to wrong ...
Hi, I have a problem: 1. Latest version of Windows 10 Home, Microsoft 365 subscription, all latest updates.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found