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.

IDNAError when trying to GET a working url

See original GitHub issue

Getting some URLs cause an IDNAError, but they work just fine with curl and other url fetchers.

Expected Result

A successful request

Actual Result

idna.core.IDNAError: The label b'xn--mn8ha4uc' is not a valid A-label
The label b'xn--mn8ha4uc' is not a valid A-label

Reproduction Steps

import requests

requests.get('https://thegroovecartel.com/feed/')

System Information

$ python -m requests.help
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": "2.2.2"
  },
  "idna": {
    "version": "2.6"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.6.4"
  },
  "platform": {
    "release": "4.15.12-201.fc26.x86_64",
    "system": "Linux"
  },
  "pyOpenSSL": {
    "openssl_version": "1010008f",
    "version": "17.5.0"
  },
  "requests": {
    "version": "2.18.4"
  },
  "system_ssl": {
    "version": "1010007f"
  },
  "urllib3": {
    "version": "1.22"
  },
  "using_pyopenssl": true
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jribbenscommented, Apr 2, 2018

Emojis are not valid in domain names… Really this is pyopenssl’s fault, it should squash the error since it isn’t relevant (invalid subjectAltName that doesn’t match the domain we’re fetching anyway).

0reactions
sigmavirus24commented, Jun 29, 2018

They’re correct. This is firmly in urllib3 in it’s urllib3.contrib.pyopenssl module that uses pyOpenSSL. That’s clear in the stack trace.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IDNAError when trying to GET a working url #4569 - GitHub
Getting some URLs cause an IDNAError, but they work just fine with curl and other url fetchers. Expected Result A successful request Actual ......
Read more >
Crawl non-latin domain with scrapy - python - Stack Overflow
When dealing with Internationalized Domain Names (IDN) you need to encode non-ascii urls with idna . You will need to decode resulting bytes ......
Read more >
Python Examples of idna.IDNAError - ProgramCreek.com
This page shows Python examples of idna.IDNAError.
Read more >
URL - Android Developers
A URL may have appended to it a "fragment", also known as a "ref" or a "reference". ... of URLStreamHandler , then the...
Read more >
How to authenticate to Jira REST API - Atlassian Community
Solved: I am using Jenkinsfile to update the Build result to one of the field using Curl command. Am using HTTP Basic auth....
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