I just wasted a lot of time coming to the following realization:
In Webware 0.8, PSP files cannot have filenames that start with the
letter x.

Here's a simple demonstration:
- In the Webware/WebKit/Examples directory, create a file named
'x.psp', with contents 'This is a PSP file.'.
- Create an identical file named 'y.psp'.
- Try to visit both with a browser.  y.psp now works as expected,
whereas x.psp raises an exception such as this:
------------------------------------------------------------------------
C:\dev\servers\Webware\WebKit\Examples\x.pspTraceback (most recent call
last):
  File ".\WebKit\Application.py", line 415, in dispatchRequest
    self.handleGoodURL(transaction)
  File ".\WebKit\Application.py", line 563, in handleGoodURL
    self.createServletInTransaction(transaction)
  File ".\WebKit\Application.py", line 1047, in
createServletInTransaction
    inst = self.getServlet(transaction,path,cache)
  File ".\WebKit\Application.py", line 990, in getServlet
    inst = factory.servletForTransaction(transaction)
  File "PSP\PSPServletFactory.py", line 183, in servletForTransaction
    instance =
self.createInstanceFromFile(trans,cachedfilename,classname,mtime,1)
  File "PSP\PSPServletFactory.py", line 125, in createInstanceFromFile
    module = self.importAsPackage(transaction,filename)
  File ".\WebKit\ServletFactory.py", line 104, in importAsPackage
    module = self._importModuleFromDirectory(fullname, name, moduleDir,
forceReload=1)
  File ".\WebKit\ServletFactory.py", line 135, in
_importModuleFromDirectory
    module = imp.load_module(fullModuleName, fp, pathname, stuff)
  File "WebKit\ImportSpy.py", line 117, in load_module
    return modloader.load_module(name,(file,filename,description))
  File "WebKit\ImportSpy.py", line 30, in load_module
    mod = ihooks.ModuleLoader.load_module(self, name, stuff)
  File "c:\dev\python\core\lib\ihooks.py", line 270, in load_module
    m = self.hooks.load_source(name, filename, file)
  File "c:\dev\python\core\lib\ihooks.py", line 168, in load_source
    return imp.load_source(name, filename, file)
ValueError: invalid \x escape
------------------------------------------------------------------------


I couldn't find the bug in a brief exploration of the code in question,
and I don't have time right now to pursue it in depth, so for the
moment I'll just name my PSPs with another first letter than 'x'.

Can anyone else confirm that this is in fact a bug, rather than some
bizarre mistake on my part?

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to