Ignore:
Timestamp:
10/17/13 13:09:10 (6 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Open csv files in universal newline mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeWidgets/Prototypes/OWCSVFileImport.py

    r10957 r11736  
    338338        self.selected_file = filename 
    339339        self.selected_file_head = [] 
    340         with open(self.selected_file, "rb") as f: 
     340        with open(self.selected_file, "rU") as f: 
    341341            for i, line in zip(range(30), f): 
    342342                self.selected_file_head.append(line) 
     
    401401    snifer = csv.Sniffer() 
    402402    if isinstance(file, basestring): 
    403         file = open(file, "rb") 
     403        file = open(file, "rU") 
    404404 
    405405    sample = file.read(2 ** 20)  # max 1MB sample 
Note: See TracChangeset for help on using the changeset viewer.