I am opening a file (csv) for reading, but during reading I get the following error:
'charmap' codec can't decode byte 0x81 in position 328: character maps to <undefined>
...
File "C:\Users\juan\source\repos\AsoVerde\AsoVerde\AsoVerde.py", line 10, in <module>
for dato in rdatos:
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\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 0x81 in position 328: character maps to <undefined>
The program 'python.exe' has exited with code -1 (0xffffffff).
Which is produced with the following script:
import csv
filename = r"C:\datos\datos.csv"
adatos = open(filename)
rdatos = csv.reader(adatos)
for dato in rdatos:
print(dato)
The error jumps on the linefor dato in rdatos