Windows10 - UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
See original GitHub issueFollowed steps to install mqttwarn on my W10 machine. Everything seemed to work including mqttwarn make-xxx commands. Finally tried running mqttwarn by itself and got strange error messages. Any help?
pip install --upgrade mqttwarn
mqttwarn make-config > mqttwarn.ini
cat mqttwarn.ini
mqttwarn make-samplefuncs > samplefuncs.py
mqttwarn
Traceback (most recent call last):
File "D:\Program Files (D)\Python37\Scripts\mqttwarn-script.py", line 33, in <module>
sys.exit(load_entry_point('mqttwarn==0.28.1', 'console_scripts', 'mqttwarn')())
File "d:\program files (d)\python37\lib\site-packages\mqttwarn\commands.py", line 93, in run
run_mqttwarn()
File "d:\program files (d)\python37\lib\site-packages\mqttwarn\commands.py", line 132, in run_mqttwarn
config = load_configuration(name=scriptname)
File "d:\program files (d)\python37\lib\site-packages\mqttwarn\configuration.py", line 196, in load_configuration
return Config(configfile, defaults=defaults)
File "d:\program files (d)\python37\lib\site-packages\mqttwarn\configuration.py", line 38, in __init__
self.read_file(f)
File "d:\program files (d)\python37\lib\configparser.py", line 717, in read_file
self._read(f, source)
File "d:\program files (d)\python37\lib\configparser.py", line 1014, in _read
for lineno, line in enumerate(fp, start=1):
File "d:\program files (d)\python37\lib\codecs.py", line 714, in __next__
return next(self.reader)
File "d:\program files (d)\python37\lib\codecs.py", line 645, in __next__
line = self.readline()
File "d:\program files (d)\python37\lib\codecs.py", line 558, in readline
data = self.read(readsize, firstline=True)
File "d:\program files (d)\python37\lib\codecs.py", line 504, in read
newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
Issue Analytics
- State:
- Created a year ago
- Comments:15 (1 by maintainers)
Top Results From Across the Web
error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff ...
When it tries this, it encounters a byte sequence which is not allowed in utf-8-encoded strings (namely this 0xff at position 0). Since...
Read more >'utf-8' codec can't decode byte 0xff in position 0: invalid start ...
I was able to fix it by opening my .pylintrc file in Notepad++, choosing the UTF-8 encoding there, and then saving the file....
Read more >'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
UnicodeDecodeError : ' utf-8 ' codec can't decode byte 0xff in position 0 : invalid start byte solved in Django .The error is...
Read more >How to fix error UnicodeDecodeError utf 8 codec cant decode ...
How to Fix Error "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte" in Python. The below error is...
Read more >[Fixed] Unicodedecodeerror: 'utf-8' Codec Can't Decode Byte ...
In conclusion, to solve UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte error, you need first to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I did that with the .py files. I opened them in notepad and immediately did a “save as” choosing utf8 and overwriting the original. Interestingly all the files I had worked with had said they were going to save as utf8 until I got to samplefuncs.py which said it would save as utf16. I changed that to utf8 and…presto! It works!
and mosquitto seemed to react. Now I just need to make some adjustments for my setup and tell it what to do when it gets a message.
Thanks for all your help.
Jim
7b42d6c improves the README correspondingly, so let me close this issue. Thanks again for making us aware of it, Jim.