~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/dispatch/request.py

  • Committer: mattgiuca
  • Date: 2008-02-06 02:48:34 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:427
setup.py: Fix (put conf.py in wrong list in listmake)
doc/setup and dependencies: Added "make" as a dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
 
225
225
        if not self.headers_written:
226
226
            self.__writeheaders()
227
 
        self.apache_req.write(string, flush)
 
227
        if isinstance(string, unicode):
 
228
            # Encode unicode strings as UTF-8
 
229
            # (Otherwise cannot handle being written to a bytestream)
 
230
            self.apache_req.write(string.encode('utf8'), flush)
 
231
        else:
 
232
            # 8-bit clean strings just get written directly.
 
233
            # This includes binary strings.
 
234
            self.apache_req.write(string, flush)
228
235
 
229
236
    def flush(self):
230
237
        """Flushes the output buffer."""
270
277
        interface if porting away from mod_python."""
271
278
        # Cache the session object
272
279
        if not hasattr(self, 'session'):
273
 
            self.session = Session.Session(self.apache_req)
 
280
            self.session = Session.FileSession(self.apache_req)
274
281
        return self.session
275
282
 
276
283
    def get_fieldstorage(self):