failed: 'charmap' codec can't decode byte ..
See original GitHub issueHey guys,
I tried to scan for e-mails and got the following error:
2022-06-09 04:21:47,904 [INFO] sfwebui : Waiting for the scan to initialize...
Process Process-3:
Traceback (most recent call last):
File "C:\Users\d.tran\Anaconda3\envs\spiderfoot\lib\multiprocessing\process.py", line 297, in _bootstrap
self.run()
File "C:\Users\d.tran\Anaconda3\envs\spiderfoot\lib\multiprocessing\process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\d.tran\Downloads\spiderfoot\sfscan.py", line 30, in startSpiderFootScanner
return SpiderFootScanner(*args, **kwargs)
File "C:\Users\d.tran\Downloads\spiderfoot\sfscan.py", line 202, in __init__
tld_data = self.__sf.cacheGet("internet_tlds", self.__config['_internettlds_cache'])
File "C:\Users\d.tran\Downloads\spiderfoot\sflib.py", line 303, in cacheGet
return fp.read()
File "C:\Users\d.tran\Anaconda3\envs\spiderfoot\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 10466: character maps to <undefined>
After a littler reasearch I found out that, this error is caused by the missing encoding during opening the cache file in sflib.py - line 302. Dunno whether this is the correct way to solve it, but I wanna share it for all other people which having problems.
Note: Forgive my, maybe, not correct way to inform you about this. It’s the first I’am doing this.
Cheers, Daniel ✌️
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
'charmap' codec can't decode byte X in position Y: character ...
I get the OP error even though the encoding is already specified correctly as UTF-8 (as shown above) in open(). Any ideas? –...
Read more >'charmap' codec can't decode byte 0x81 in position X ... - GitHub
OS: Windows Pytext Version: Tried with 1.10.0 and 1.11.1, error stack on 1.11.1 I am having this error when trying to use the...
Read more >'charmap' codec can't decode byte 0x9d – Python File Read
File reading error in python with the following message UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 12345 ...
Read more >'charmap' codec can't decode byte 0x81 in position 34: character
You should set the encoding when you read the file (fileinput). Windows must thing it is something other than utf-8. Reply.
Read more >UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d ...
In the chapter 10_NLP, executing the below code gives an error - txts = L(o.open().read() for o in files[:2000]) UnicodeDecodeError: ...
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
Yeah there’s issues with caching. I started working on a patch for this but got sidetracked.
This has now been fixed (applied the PR from @guylando - thanks again).