TypeError: write() argument must be str, not bytes

issue solved.

Photo by Sebastian Herrmann on Unsplash

I was trying to open the file in ‘w’(write) mode and I got error like below.

file opened in ‘w’ mode

So, the simple solution is to change the file opening model from w to wb. like below:

the file should be opened in ‘wb’ mode

I hope your problem is solved now, please clap and SUBSCRIBE my YOUTUBE channel.

Click here!

Thanks!

--

--

Muhammad Iqbal bazmi

A self-taught programmer, Data Scientist and Machine Learning Engineer