[meld/Python3] dirdiff: Remove handling for non-UTF8 dates; these are unicode now
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/Python3] dirdiff: Remove handling for non-UTF8 dates; these are unicode now
- Date: Sat, 18 Jun 2016 01:23:49 +0000 (UTC)
commit 262d6b16404c879b202f849a65b3ce5911cb9fdd
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sat Jun 18 11:20:41 2016 +1000
dirdiff: Remove handling for non-UTF8 dates; these are unicode now
In Python 2, datetime.strftime() returned a byte string in the current
locale; in Python 3 we get a unicode, which GTK+ will happily handle.
I've tested this change against the previous test case that broke it,
being a non-UTF8 French locale when displaying "février".
meld/dirdiff.py | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 0bad7ee..708d3b0 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -21,7 +21,6 @@ import copy
import datetime
import errno
import functools
-import locale
import os
import re
import shutil
@@ -1320,7 +1319,6 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
all_present_same = self.file_compare(lof, regexes)
different = 1
one_isdir = [None for i in range(self.model.ntree)]
- locale_encoding = locale.getpreferredencoding()
for j in range(self.model.ntree):
if mod_times[j]:
isdir = os.path.isdir( files[j] )
@@ -1348,7 +1346,6 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
TIME = self.model.column_index(COL_TIME, j)
mod_datetime = datetime.datetime.fromtimestamp(mod_times[j])
time_str = mod_datetime.strftime("%a %d %b %Y %H:%M:%S")
- time_str = time_str.decode(locale_encoding, errors='replace')
self.model.set_value(it, TIME, time_str)
def natural_size(bytes):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]