[Webkit-unassigned] [Bug 31603] New: WebSocket server is confused if WebKit tests run from within /tmp on Mac OS X

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 17 16:26:41 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=31603

           Summary: WebSocket server is confused if WebKit tests run from
                    within /tmp on Mac OS X
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Tools / Tests
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: mrowe at apple.com
                CC: ap at webkit.org, yuzo at google.com


On Mac OS X /tmp is a symlink to /private/tmp.  If the WebSocket server is
started from below this directory it gets confused and logs errors rather than
serving content:

mrowe at angara:/tmp/WebKit$ PYTHONPATH=WebKitTools/pywebsocket /usr/bin/python
WebKitTools/pywebsocket/mod_pywebsocket/standalone.py -p 2048 -d
$PWD/LayoutTests -s $PWD/LayoutTests/websocket/tests
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 50785)
Traceback (most recent call last):
  File
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py",
line 558, in process_request_thread
    self.finish_request(request, client_address)
  File
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py",
line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "WebKitTools/pywebsocket/mod_pywebsocket/standalone.py", line 170, in
__init__
    WebSocketRequestHandler.options.scan_dir)
  File
"/private/tmp/WebKit/WebKitTools/pywebsocket/mod_pywebsocket/dispatch.py", line
141, in __init__
    'root_dir:%s.' % (scan_dir, root_dir))
DispatchError: scan_dir:/tmp/WebKit/LayoutTests/websocket/tests must be a
directory under root_dir:..
----------------------------------------

This happens because dispatch.py uses the following code to determine if
scan_dir is below root_dir:
os.path.abspath(scan_dir).startswith(os.path.abspath(root_dir))

scan_dir is “/tmp/WebKit/LayoutTests/websocket/tests” and so abspath(scan_dir)
evalutes to "/tmp/WebKit/LayoutTests/websocket/tests”.
root_dir is “.” and so abspath(root_dir) evaluates to
“/private/tmp/WebKit/LayoutTests”.

I suspect this code wants to be using os.path.realpath rather than
os.path.abspath.  This returns the canonical version of the path and therefore
is not confused by the /tmp symlink.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list