Changeset 11736:4ba6adf251c2 in orange


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.

Location:
Orange
Files:
2 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 
  • Orange/data/io.py

    r10957 r11736  
    597597    """ 
    598598    import csv, numpy 
    599     file = as_open_file(file, "rb") 
     599    file = as_open_file(file, "rU") 
    600600    snifer = csv.Sniffer() 
    601601 
Note: See TracChangeset for help on using the changeset viewer.