--- request.py-dist	2007-01-03 12:04:56.000000000 +1300
+++ request.py	2007-05-03 16:54:41.000000000 +1200
@@ -370,6 +370,16 @@
 
         # REQUEST_URI is not part of CGI spec, but an addition of Apache.
         self.request_uri = env.get('REQUEST_URI', '')
+
+        # work around mod-rewrite bug which turns %3f into '?'
+        # see http://issues.apache.org/bugzilla/show_bug.cgi?id=34602
+        # and http://moinmoin.wikiwikiweb.de/MoinMoinBugs/CannotAccessPagesEndingWithAQuestionMark
+        modrewrite_fix = True
+        if modrewrite_fix:
+            path = self.request_uri
+            if path.find('?') != -1:
+                path = path[:path.find('?')]
+            self.path_info = wikiutil.url_unquote(path, want_unicode=False)
         
         # Values that need more work
         self.setHttpReferer(env.get('HTTP_REFERER'))
