Could you use webob 1.2 not 1.2b3? Because there's issues in 1.2b3 and I experienced that some tests failed against SAIO with webob1.2b3.<div><br></div><div>And, if you can share brief config of the normal server, I can set my machines and reproduce functests failing.</div>
<div><br></div><div>- Iryoung</div><div><br><div class="gmail_quote">On Thu, Jun 7, 2012 at 10:45 AM, Pete Zaitcev <span dir="ltr"><<a href="mailto:zaitcev@redhat.com" target="_blank">zaitcev@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mon, 4 Jun 2012 14:40:21 +0900<br>
iryoung jeong <<a href="mailto:iryoung@gmail.com">iryoung@gmail.com</a>> wrote:<br>
<br>
</div><div class="im">> Anyway, current status is that I make your PatchSet 3 passed all<br>
> unit/functests with webob 1.1 and only 4 tests failed with webob 1.2b3.<br>
> After I compared my patch & your patchsets, I thought they looks similar,<br>
> therefore I rebased my patch based on PatchSet 3 and keep trying to make<br>
> them pass functests.<br>
<br>
</div>Here's a fix for the problem with proxy_logging middleware.<br>
As I mentioned I run functional tests against a reasonably normal<br>
server, not SAIO.<br>
<br>
Please look at this and incorporate in change 8195. However, I must<br>
note that I have 22 functional tests still failing on WebOb 1.2b3.<br>
I'm going to continue working on resolving these issues.<br>
<br>
-- Pete<br>
<br>
commit f629016447e6156a8f9da7d94358427e47c2f375<br>
Author: Pete Zaitcev <<a href="mailto:zaitcev@kotori.zaitcev.us">zaitcev@kotori.zaitcev.us</a>><br>
Date:   Wed Jun 6 19:34:06 2012 -0600<br>
<br>
    Update 1 for Iryoung's patch #3 for change 8195<br>
<br>
    Traceback (most recent call last):<br>
      File "/usr/lib/python2.7/site-packages/swift/common/middleware/proxy_logging.py", line 205, in iter_response<br>
        client_disconnect or input_proxy.client_disconnect)<br>
      File "/usr/lib/python2.7/site-packages/swift/common/middleware/proxy_logging.py", line 120, in log_request<br>
        the_request = quote(unquote(req.path))<br>
      File "/usr/lib/python2.7/site-packages/webob/request.py", line 482, in path<br>
        bpath = bytes_(self.path_info, self.url_encoding)<br>
      File "/usr/lib/python2.7/site-packages/webob/descriptors.py", line 68, in fget<br>
        return req.encget(key, encattr=encattr)<br>
      File "/usr/lib/python2.7/site-packages/webob/request.py", line 174, in encget<br>
        return val.decode(encoding)<br>
      File "/usr/lib64/python2.7/encodings/utf_8.py", line 16, in decode<br>
        return codecs.utf_8_decode(input, errors, True)<br>
    UnicodeDecodeError: 'utf8' codec can't decode byte 0x8f in position 12: invalid start byte<br>
<br>
diff --git a/swift/common/middleware/proxy_logging.py b/swift/common/middleware/proxy_logging.py<br>
index 66c853c..55ab14d 100644<br>
--- a/swift/common/middleware/proxy_logging.py<br>
+++ b/swift/common/middleware/proxy_logging.py<br>
@@ -44,6 +44,9 @@ from webob import Request<br>
<br>
 from swift.common.utils import get_logger, get_remote_client, TRUE_VALUES<br>
<br>
+import codecs<br>
+utf8_decoder = codecs.getdecoder('utf-8')<br>
+<br>
<br>
 class InputProxy(object):<br>
     """<br>
@@ -115,7 +118,13 @@ class ProxyLoggingMiddleware(object):<br>
         req = Request(env)<br>
         if client_disconnect:  # log disconnected clients as '499' status code<br>
             status_int = 499<br>
-        the_request = quote(unquote(req.path))<br>
+        # Do not try to access req.path: crash in req.encget if invalid UTF-8.<br>
+        req_path = env.get('PATH_INFO','')<br>
+        if isinstance(req_path, str):<br>
+            (req_path,_len) = utf8_decoder(req_path,'replace')<br>
+        # Fold back to UTF-8 or else quote() tracebacks immediately below.<br>
+        req_path = req_path.encode('utf-8')<br>
+        the_request = quote(unquote(req_path))<br>
         if req.query_string:<br>
             the_request = the_request + '?' + req.query_string<br>
         logged_headers = None<br>
</blockquote></div><br></div>