universal newlines when importing

This commit is contained in:
Damien Elmes 2009-07-02 23:23:05 +09:00
parent a9bb1639c0
commit a73e4757ad

View file

@ -71,7 +71,7 @@ class TextImporter(Importer):
def openFile(self): def openFile(self):
self.dialect = None self.dialect = None
self.fileobj = open(self.file, "rb") self.fileobj = open(self.file, "rbU")
self.data = self.fileobj.read() self.data = self.fileobj.read()
self.data = re.sub("^ *#.*", "", self.data) self.data = re.sub("^ *#.*", "", self.data)
self.data = [x for x in self.data.split("\n") if x] self.data = [x for x in self.data.split("\n") if x]