pipreqs icon indicating copy to clipboard operation
pipreqs copied to clipboard

added apparent_encoding to the decoding of pypi's json response

Open matl4c opened this issue 3 years ago • 1 comments

The json response from pypi is not guaranteed to be all of the expected default encoding. When characters in a pypi package information are not the default encoding, this line here will error out. By using response.apparent_encoding, the encoding type is taken from the request's response to allow for a proper decode.

There are a lot of repositories that cause issues like this, but here is an example: https://pypi.org/project/imath/

matl4c avatar Jul 21 '22 01:07 matl4c

Hi, thanks for the PR! Could you add a test to this?

jonas-eschle avatar Apr 07 '25 15:04 jonas-eschle