vivekkoya / classfiles

File opened without the with statement PTC-W0010
Anti-pattern
Critical
a year agoa year old
Use the with statement to open a file
 19
 20def convert(file_name):
 21    # Open csv file
 22    csv = io.open(file_name + ".csv", mode="w", encoding="utf-8") 23
 24# Convert file_name.tsv to file_name.csv
 25    with io.open(file_name + ".tsv", mode="r", encoding="windows-1252") as tsv: