]> git.parisson.com Git - timeside.git/commitdiff
Fix some bad unicode support when exported to h5py
authorThomas Fillon <thomas@parisson.com>
Tue, 29 Apr 2014 13:00:57 +0000 (15:00 +0200)
committerThomas Fillon <thomas@parisson.com>
Tue, 29 Apr 2014 13:00:57 +0000 (15:00 +0200)
In server mode there was a TypeError raise by h5py on some unicode
TypeError: No conversion path for dtype: dtype('<U*')
see https://github.com/h5py/h5py/issues/289

This commit in a temporary work-around until h5py get fixed

timeside/analyzer/h5tools.py
timeside/decoder/file.py

index 2db446eb64d9a4b3c89efddc0fbb95e8d6cb5ef9..67e61371740afdbf448806e9941a0af1b671842f 100644 (file)
@@ -29,6 +29,7 @@ def dict_to_hdf5(dict_like, h5group):
     attrs = dict_like.keys()
     for name in attrs:
         if dict_like[name] is not None:
+            print (name, dict_like[name])
             h5group.attrs[str(name)] = dict_like[name]
 
 
index 88bedc1b995abcb96b35acf96b6e411bcec12b1c..41b32934459154194273384a6e39d69a55aca1dd 100644 (file)
@@ -70,12 +70,12 @@ class FileDecoder(Decoder):
         self.from_stack = False
         self.stack = stack
 
-        self.uri = get_uri(uri)
+        self.uri = get_uri(uri).encode('utf8')
 
         if not sha1:
             self._sha1 = get_sha1(uri)
         else:
-            self._sha1 = sha1
+            self._sha1 = sha1.encode('utf8')
 
         self.uri_total_duration = get_media_uri_info(self.uri)['duration']