Funny error message

Peter Otten __peter__ at web.de
Fri Jan 1 05:03:34 EST 2021


On 31/12/2020 23:46, Bob van der Poel wrote:

> When I run python from the command line and generate an error I get the
> following:
> 
> Python 3.8.5 (default, Jul 28 2020, 12:59:40)
> [GCC 9.3.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>>>> z
> /home/bob/.local/lib/python3.8/site-packages/requests/__init__.py:89:
> RequestsDependencyWarning: urllib3 (1.24.3) or chardet (4.0.0) doesn't
> match a supported version!
>    warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
> NameError: name 'z' is not defined
> 
> I understand "z in not defined" ... but what's with the warnings?

It looks like Python tries to import requests as a side effect of 
printing the traceback.
Start the interpreter in verbose mode

$ python -v

and trigger the name error again to see which module triggers that import.



More information about the Python-list mailing list