[h5py] 274/455: Enable unicode for is_hdf5

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:41 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.

commit cc992f7758a41c2a5325a2c9604186e048eec05e
Author: andrewcollette <andrew.collette at gmail.com>
Date:   Thu Jun 11 03:15:02 2009 +0000

    Enable unicode for is_hdf5
---
 h5py/highlevel.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/h5py/highlevel.py b/h5py/highlevel.py
index eb9ec41..4b06568 100644
--- a/h5py/highlevel.py
+++ b/h5py/highlevel.py
@@ -55,8 +55,13 @@ def _hbasename(name):
 def is_hdf5(fname):
     """ Determine if a file is valid HDF5 (False if it doesn't exist). """
     fname = os.path.abspath(fname)
+
     if os.path.isfile(fname):
         try:
+            try:
+                fname = fname.encode(sys.getfilesystemencoding())
+            except UnicodeError:
+                pass
             return h5f.is_hdf5(fname)
         except H5Error:
             pass

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git



More information about the debian-science-commits mailing list