I'm trying to format a file so that it can be inserted into a database, the file is originally compressed and arround 1.3MB big. Each line looks something like this:
398,%7EAnoniem+001%7E,543,480,7525010,1775,0
This is how the code looks like that parses this file:
Village = gzip.open(Root+'\\data'+'\\' +str(Newest_Date[0])+'\\' +str(Newest_Date[1])+'\\' +str(Newest_Date[2])\
+'\\'+str(Newest_Date[3])+' village.gz');
Village_Parsed = str
for line in Village:
Village_Parsed = Village_Parsed + urllib.parse.unquote_plus(line);
print(Village.readline());
When I run the program I get this error:
Village_Parsed = Village_Parsed + urllib.parse.unquote_plus(line);
file "C:\Python31\lib\urllib\parse.py", line 404, in unquote_plus string = string.replace('+', ' ') TypeError: expected an object with the buffer interface
Any idea what is wrong here? Thanks in advance for any help :)