bndr / pipreqs

pipreqs - Generate pip requirements.txt file based on imports of any project. Looking for maintainers to move this project forward.
Apache License 2.0
6.38k stars 388 forks source link

added apparent_encoding to the decoding of pypi's json response #316

Open matl4c opened 2 years ago

matl4c commented 2 years ago

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/