[vlc-commits] Fix potential bug in bytes_to_str

Olivier Aubert git at videolan.org
Thu Mar 21 22:38:24 CET 2013


vlc/python | branch: master | Olivier Aubert <olivier.aubert at liris.cnrs.fr> | Thu Mar 21 22:37:23 2013 +0100| [b2e85cfe8b91b53e24132226ec7a79fa1554b82b] | committer: Olivier Aubert

Fix potential bug in bytes_to_str

The missing code path is not followed in any case, but better safe than sorry.

> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=b2e85cfe8b91b53e24132226ec7a79fa1554b82b
---

 generated/vlc.py |    6 ++++--
 header.py        |    2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/generated/vlc.py b/generated/vlc.py
index 343be16..b8289fb 100755
--- a/generated/vlc.py
+++ b/generated/vlc.py
@@ -48,7 +48,7 @@ import sys
 from inspect import getargspec
 
 __version__ = "N/A"
-build_date  = "Wed Feb 13 18:40:24 2013"
+build_date  = "Thu Mar 21 22:33:03 2013"
 
 if sys.version_info[0] > 2:
     str = str
@@ -70,7 +70,7 @@ if sys.version_info[0] > 2:
         if isinstance(b, bytes):
             return b.decode(sys.getfilesystemencoding())
         else:
-            return b
+            return str(b)
 else:
     str = str
     unicode = unicode
@@ -90,6 +90,8 @@ else:
         """
         if isinstance(b, str):
             return unicode(b, sys.getfilesystemencoding())
+        else:
+            return b
 
 # Internal guard to prevent internal classes to be directly
 # instanciated.
diff --git a/header.py b/header.py
index 4b065d9..05a70ea 100755
--- a/header.py
+++ b/header.py
@@ -89,6 +89,8 @@ else:
         """
         if isinstance(b, str):
             return unicode(b, sys.getfilesystemencoding())
+        else:
+            return b
 
 # Internal guard to prevent internal classes to be directly
 # instanciated.



More information about the vlc-commits mailing list