Answer the question
In order to leave comments, you need to log in
What does it mean: TypeError: expected str, bytes or os.PathLike object, not NoneType?
Error log:
Traceback (most recent call last):
File "C:\Users\Ternick\Desktop\1\main.py", line 203, in <module>
main()
File "C:\Users\Ternick\Desktop\1\main.py", line 174, in main
sendImage(chat_id, a)
File "C:\Users\Ternick\Desktop\1\main.py", line 141, in sendImage
with open(path_to_mg, 'rb') as path_to_mg_god:
TypeError: expected str, bytes or os.PathLike object, not NoneType
[Finished in 350.7s]
Answer the question
In order to leave comments, you need to log in
The error says that it path_to_mg
stores in itself None
, that is, there is nothing there.
And Python expects that there will be, for example, a string (str) or a PathLike object, which you can read about in the official documentation
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question