question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 16380: character maps to <undefined>

See original GitHub issue

Suddenly I’m getting this error when trying to update my host list by running custom profile:

python updateHostsFile.py --auto --backup --extensions porn gambling fakenews

Full output:

Updating source data\adaway.org from https://raw.githubusercontent.com/AdAway/adaway.github.io/master/hosts.txt
Updating source data\add.2o7Net from https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.2o7Net/hosts
Updating source data\add.Dead from https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Dead/hosts
Updating source data\add.Risk from https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Risk/hosts
Updating source data\add.Spam from https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Spam/hosts
Updating source data\Badd-Boyz-Hosts from https://raw.githubusercontent.com/mitchellkrogza/Badd-Boyz-Hosts/master/hosts
Updating source data\CoinBlockerList from https://raw.githubusercontent.com/ZeroDot1/CoinBlockerLists/master/hosts_browser
Updating source data\KADhosts from https://raw.githubusercontent.com/azet12/KADhosts/master/KADhosts.txt
Updating source data\malwaredomainlist.com from http://www.malwaredomainlist.com/hostslist/hosts.txt
Updating source data\mvps.org from http://winhelp2002.mvps.org/hosts.txt
Updating source data\someonewhocares.org from http://someonewhocares.org/hosts/zero/hosts
Updating source data\StevenBlack from https://raw.githubusercontent.com/StevenBlack/hosts/master/data/StevenBlack/hosts
Updating source data\UncheckyAds from https://raw.githubusercontent.com/FadeMind/hosts.extras/master/UncheckyAds/hosts
Updating source data\yoyo.org from https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext&useip=0.0.0.0
Updating source extensions\fakenews from https://raw.githubusercontent.com/marktron/fakenews/master/fakenews
Updating source extensions\gambling from https://raw.githubusercontent.com/Sinfonietta/hostfiles/master/gambling-hosts
Updating source extensions\porn\clefspeare13 from https://raw.githubusercontent.com/Clefspeare13/pornhosts/master/0.0.0.0/hosts
Updating source extensions\porn\sinfonietta from https://raw.githubusercontent.com/Sinfonietta/hostfiles/master/pornography-hosts
Updating source extensions\porn\sinfonietta-snuff from https://raw.githubusercontent.com/Sinfonietta/hostfiles/master/snuff-hosts
Updating source extensions\social from https://raw.githubusercontent.com/Sinfonietta/hostfiles/master/social-hosts
Traceback (most recent call last):
  File "updateHostsFile.py", line 1500, in <module>
    main()
  File "updateHostsFile.py", line 187, in main
    merge_file = create_initial_file()
  File "updateHostsFile.py", line 636, in create_initial_file
    write_data(merge_file, curFile.read())
  File "C:\Program Files (x86)\Python36-32\lib\encodings\cp1257.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 16380: character maps to <undefined>

It was working fine few weeks ago. Updated the program to the latest version, but still this error.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
funilryscommented, May 16, 2018

This time Steven @StevenBlack it is because we do not touch/convert to idna the commented lines …

The issue is the following

# Office Telemetry Upload Reporting – ‘Heartbeart’ and error events that 
                                   ---^
0reactions
StevenBlackcommented, Sep 7, 2018

@gfyoung yup!

Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'charmap' codec can't decode byte X in position Y: character ...
If the file contains characters of values not defined in this codepage (like 0x90) we get UnicodeDecodeError . Sometimes we don't know the...
Read more >
'charmap' codec can't decode byte 0x81 in position X ... - GitHub
... UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 29343726: character maps to <undefined>. I fixed it by adding the parameter ...
Read more >
UnicodeDecodeError: 'charmap' codec can't decode byte
The Python "UnicodeDecodeError: 'charmap' codec can't decode byte in position" occurs when we specify an incorrect encoding or don't explicitly ...
Read more >
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d
Solved - UnicodeDecodeError : ' charmap ' codec can't decode byte 0x9d ... can't decode byte 0x9d in position 6552: character maps to...
Read more >
'charmap' codec can't decode byte 0x9d in position ... - YouTube
ÕzbekchaXatolik: UnicodeDecodeError : ' charmap ' codec can't decode byte 0x9d in position 2045: character maps to undefined #python #progra...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found