[pitivi] Handle unicode when deserializing object factories.
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi] Handle unicode when deserializing object factories.
- Date: Thu, 30 Apr 2009 12:18:50 -0400 (EDT)
commit 1afe4445b51b165b252182fb31a84ec9d3b9b75d
Author: Alessandro Decina <alessandro d gmail com>
Date: Mon Apr 27 21:23:20 2009 +0200
Handle unicode when deserializing object factories.
Fixes #579410 even more.
---
pitivi/formatters/etree.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/pitivi/formatters/etree.py b/pitivi/formatters/etree.py
index 189cef7..d3971c7 100644
--- a/pitivi/formatters/etree.py
+++ b/pitivi/formatters/etree.py
@@ -159,9 +159,13 @@ class ElementTreeFormatter(Formatter):
def _loadObjectFactory(self, klass, element):
self.debug("klass:%r, element:%r", klass, element)
- # FIXME
- filename = self.validateSourceURI(element.attrib.get("filename", None))
- if not filename:
+ filename = element.attrib.get("filename", None)
+ if filename is None:
+ return
+ if isinstance(filename, unicode):
+ filename = filename.encode("utf-8")
+ filename = self.validateSourceURI(filename)
+ if filename is None:
return None
if issubclass(klass, FileSourceFactory):
factory = FileSourceFactory(filename)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]