Sniffer expects a sample string, not a file. All you should need to do is:
dialect = csv.Sniffer().sniff(csvfile.readline(), [',',';'])
csvfile.seek(0)
data = csv.reader(csvfile, dialect)
The seek is important, because you are moving your current position in the file with the readline command, and you need to reset back to the beginning of the file. Otherwise you lose data.