[Zope3-checkins] CVS: Zope3/src/zope/app/content - fssync.py:1.8

Guido van Rossum guido@python.org
Wed, 28 May 2003 18:34:38 -0400


Update of /cvs-repository/Zope3/src/zope/app/content
In directory cvs.zope.org:/tmp/cvs-serv9631

Modified Files:
	fssync.py 
Log Message:
A ZPT Page wants its source in Unicode.


=== Zope3/src/zope/app/content/fssync.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/content/fssync.py:1.7	Tue May 27 10:18:14 2003
+++ Zope3/src/zope/app/content/fssync.py	Wed May 28 18:34:38 2003
@@ -58,7 +58,10 @@
         return self.context.getSource()
 
     def setBody(self, data):
-        self.context.setSource(data)
+        # Convert the data to Unicode, since that's what ZPTPage wants;
+        # it's normally read from a file so it'll be bytes.
+        # XXX This will die if it's not ASCII.  Guess encoding???
+        self.context.setSource(unicode(data))
 
 class DTMLPageAdapter(ObjectEntryAdapter):