Index: trunk/tools/editor_trends/utils/file_utils.py |
— | — | @@ -55,6 +55,18 @@ |
56 | 56 | #RE_ERROR_LOCATION = re.compile('\d+') |
57 | 57 | #RE_NUMERIC_CHARACTER = re.compile('&#?\w+;') |
58 | 58 | |
| 59 | +def read_unicode_text(fh): |
| 60 | + data = [] |
| 61 | + try: |
| 62 | + for line in fh: |
| 63 | + line = line.strip() |
| 64 | + data.append(line) |
| 65 | + except UnicodeDecodeError, e: |
| 66 | + print e |
| 67 | + |
| 68 | + return data |
| 69 | + |
| 70 | + |
59 | 71 | def check_if_process_is_running(pid): |
60 | 72 | try: |
61 | 73 | if settings.OS == 'Windows': |
— | — | @@ -240,7 +252,6 @@ |
241 | 253 | assert isinstance(mod_rem, datetime.datetime), '''The mod_rem variable should |
242 | 254 | be an instane of datetime.datetime.''' |
243 | 255 | path = os.path.join(location, filename) |
244 | | - mod_rem = mod_rem.timetuple() |
245 | 256 | mod_rem = int(time.mktime(mod_rem.timetuple())) |
246 | 257 | os.utime(path, (mod_rem, mod_rem)) |
247 | 258 | #sraise exceptions.NotYetImplementedError(set_modified_data) |