UnicodeDecodeError.object
inferred as str
instead of bytes
#9342
Labels
Milestone
UnicodeDecodeError.object
inferred as str
instead of bytes
#9342
Bug description
In #3639, it was reported that accessing
UnicodeDecodeError.object
resulted in an error. pylint-dev/astroid#797 fixed this, unfortunately incorrectly. Pylint thinksUnicodeDecodeError.object
is of typestr
, when it is actually of typebytes
. (AUnicodeDecodeError
occurs when decoding abytes
object;str
is the result.)Example code (file
test.py
):Output when run via
python test.py
:Error: 80
I don't know anything about astroid, but I'd guess the fix is to change this line as follows:
Configuration
No response
Command used
Pylint output
Expected behavior
No Pylint errors.
Pylint version
OS / Environment
Windows 11, Git Bash
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: