Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 g Null Byte using DictReader
This below error is fixed.
utf-8' codec can't decode byte 0xa0 in position 252862: invalid start byte

but currently getting error.
_csv.Error: line contains NULL byte
on line "for line in reader:"

the below error is fixed.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 252862: invalid start byte

but getting the below error now.
_csv.Error: line contains NULL byte
at line "for line in reader:"
can you post minimal example that reproduce your problem as well as the input file you work with
Hi Buran,
this code is a part of my project.
and the csv file I am reading it from rest api which contains NULL Byte.

def getCSV(csv_file):
    stream = io.StringIO('utf-8'),  newline=None)
    reader = csv.DictReader(stream)

    list_of_entity = []
    line_no, prev_len = 1, 0,
    for line in reader:
cant share the csv as it has confidential data.

thank you for understanding.
at the moment I cannot suggest anything helpful. maybe someone else could help more

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  'utf-8' codec can't decode byte 0xda in position 184: invalid continuation byte karkas 7 396 Sep-12-2019, 11:19 PM
Last Post: newbieAuggie2019
  Handling null or empty entries from Entry Widget KevinBrown 1 283 Mar-17-2019, 04:22 PM
Last Post: perfringo
  Array/Jarray problem contains null value? Maverick0013 1 849 Aug-10-2018, 12:56 PM
Last Post: Windspar
  Replace null values in Json file burnsssss 11 8,310 Jun-11-2018, 09:45 AM
Last Post: burnsssss
  4 byte hex byte swap from binary file medievil 7 6,956 May-08-2018, 08:16 AM
Last Post: killerrex
  csv.reader vs csv.dictReader mepyyeti 3 6,583 Mar-20-2018, 08:31 AM
Last Post: buran
  xmlrpc.client, ServerProxy and null return thepurpleblob 0 1,100 Oct-26-2017, 10:26 AM
Last Post: thepurpleblob

Forum Jump:

Users browsing this thread: 1 Guest(s)