[viewvc-dev] [PATCH] WSGI server: Attribute error with pathrev URL

Ennio Zarlenga <[email protected]> Fri, 7 Oct 2011 05:04:47 -0700 (PDT)
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Message-ID <1733991900.15220.1317989087010.JavaMail.httpd@localhost>
This is the same as issue #454 (AttributeError exception trying to escape non-string input), but for WSGI server.

Side question: why does WSGI use cgi.escape() instead of sapi.escape() ?

------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4251&dsMessageId=2850628

To unsubscribe from this discussion, e-mail: [[email protected]].
sapi-wsgi.patch (application/octet-stream, 432 B)
Index: sapi.py
===================================================================
--- sapi.py	(revision 2613)
+++ sapi.py	(working copy)
@@ -234,7 +234,7 @@
     self._wsgi_write('This document is located <a href="%s">here</a>.' % url)
 
   def escape(self, s, quote = None):
-    return cgi.escape(s, quote)
+    return cgi.escape(str(s), quote)
 
   def getenv(self, name, value=None):
     return self._environ.get(name, value)