psf / requests

A simple, yet elegant, HTTP library.

Home Page:https://requests.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected `UnicodeError` on some URL

catap opened this issue · comments

Seems that requests haven't handle well some url which curl handle quite well.

Expected Result

Should work.

Actual Result

Crashed as UnicodeError: label empty or too long

Reproduction Steps

import requests

requests.get("https://www.elyricsworld.com/go.php?url=http://894763313no67.%D1%86%D0%B5%D0%BD%D1%82%D1%80-%D1%81%D1%82%D1%80%D0%B0%D1%85%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F-%D0%BE%D0%BD%D0%BB%D0%B0%D0%B9%D0%BD.%D1%80%D1%84")

System Information

{
  "chardet": {
    "version": null
  },
  "charset_normalizer": {
    "version": "3.3.2"
  },
  "cryptography": {
    "version": "41.0.5"
  },
  "idna": {
    "version": "3.4"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.10.13"
  },
  "platform": {
    "release": "21.6.0",
    "system": "Darwin"
  },
  "pyOpenSSL": {
    "openssl_version": "30100040",
    "version": "23.2.0"
  },
  "requests": {
    "version": "2.31.0"
  },
  "system_ssl": {
    "version": "30200000"
  },
  "urllib3": {
    "version": "1.26.18"
  },
  "using_charset_normalizer": true,
  "using_pyopenssl": true
}

I want to work on this, it would be great if anyone assign this to me!

Duplicate of #6026 #4187 and many others