Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'charmap' codec
#2
I think it is the "r" outside the quotes in your file name is giving you problems.

If you are trying to open the file to read only, I think the "r" belongs here:
with open(file_name, r) as f_obj:
Not 100% on that, just a best guess.
Reply


Messages In This Thread
'charmap' codec - by louis216 - Jun-30-2020, 03:37 AM
RE: 'charmap' codec - by michael1789 - Jun-30-2020, 04:39 AM
RE: 'charmap' codec - by Larz60+ - Jun-30-2020, 05:01 AM
RE: 'charmap' codec - by bowlofred - Jun-30-2020, 05:11 AM
RE: 'charmap' codec - by louis216 - Jun-30-2020, 06:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] [Debian] UnicodeEncodeError: 'ascii' codec Winfried 1 1,037 Nov-16-2022, 11:41 AM
Last Post: Winfried
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 34: character Melcu54 7 19,076 Sep-26-2022, 10:09 AM
Last Post: Melcu54
  ASCII-Codec in Python3 [SOLVED] AlphaInc 4 6,178 Jul-07-2021, 07:05 PM
Last Post: AlphaInc
  codec for byte transparency Skaperen 7 3,872 Sep-25-2020, 02:20 AM
Last Post: Skaperen
  Which codec can help me decode the html source? vivekagrey 4 3,208 Jan-10-2020, 09:33 AM
Last Post: DeaD_EyE
  charmap codec can't decode byte error with gzipped file in python bluethundr 2 3,735 Apr-30-2019, 12:26 PM
Last Post: bluethundr
  UnicodeEncodeError: 'charmap' codec can't encode character '\u2019' in position 23: c kapilan15 2 4,444 Jan-14-2019, 09:11 PM
Last Post: Gribouillis
  Countryinfo package charmap error mkaru 6 7,304 Sep-16-2018, 02:58 PM
Last Post: snippsat
  python charmap codec can't decode byte X in position Y character maps to < undefined> owais 9 39,172 Apr-28-2018, 10:52 PM
Last Post: abadawi
  Exchange2org - Charmap Encode issue r7rajkumar 1 3,332 Feb-19-2018, 09:37 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020