[Webware-devel] EOFError when using mod_webkit2

2009-01-20 Thread Jehiah Czebotar
I'm in the process of upgrading to Webware 1.0 and when i'm trying use
use webkit (via mod_webkit2) i get this error

File /usr/local/Webware/WebKit/ThreadedAppServer.py, line 916, in receiveDict
return loads(chunk)
EOFError: EOF read where object expected

I am only having this problem on some machines but i haven't been able
to narrow down what is causing it. All configurations and libraries
seem to be the same.

If anyone on this list has any suggestions I'd appreciate it.

-- 
Jehiah
http://jehiah.cz/

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel


Re: [Webware-devel] EOFError when using mod_webkit2

2009-01-20 Thread Jehiah Czebotar
Thanks for the ideas Jason, i actually just nailed the problem (after
troubleshooting along with a few other people for a few days)

I opened this bug for it (with a patch attached)

https://sourceforge.net/tracker2/?func=detailaid=2524767group_id=4866atid=104866

It's a problem in ThreadedAppServer keeping track of the # of bytes
remaining to be read from the socket, which is only apparent when
there is some delay in receiving data. (which for me means when webkit
and apache are on different servers). So that also explains why it was
intermittent.

--
Jehiah
http://jehiah.cz/

On Tue, Jan 20, 2009 at 3:58 PM, Jason Hildebrand ja...@peaceworks.ca wrote:
 Hi Jehiah,

 Is this happening on some requests (occasionally), or on every request?

 If only occasionally, it's possible that some network tool or software is 
 connecting directly to your appserver (on port 8080 or whatever you are 
 using), and that the request is not coming via Apache.  I've seen this 
 happen; the solution is to firewall the appserver port so that is it only 
 accessible on localhost (assuming apache and webware are running on the same 
 host).

 peace,
 Jason

 --
 Jason Hildebrand
 PeaceWorks Computer Consulting
 #2 - 396 Assiniboine Ave, Winnipeg
 204 480 0314   --or--   519 725 7875, ext 620.

 - Jehiah Czebotar jeh...@gmail.com wrote:

 I'm in the process of upgrading to Webware 1.0 and when i'm trying
 use
 use webkit (via mod_webkit2) i get this error

 File /usr/local/Webware/WebKit/ThreadedAppServer.py, line 916, in
 receiveDict
 return loads(chunk)
 EOFError: EOF read where object expected

 I am only having this problem on some machines but i haven't been
 able
 to narrow down what is causing it. All configurations and libraries
 seem to be the same.

 If anyone on this list has any suggestions I'd appreciate it.

 --
 Jehiah
 http://jehiah.cz/


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel


Re: [Webware-devel] question about how Webware/WebKit handles exceptions

2008-12-15 Thread Jehiah Czebotar
thanks for the response Christoph.

Inheriting from Exception is probably good advice, and i'll just patch
my version of webware to handle things differently as i audit my code
to make updates to exception handling.

that's probably what i get for trying to update to version 1.0
straight from a 6 year old version of trunk. =)

no need to change the functionality on my account; especially if it
was there in recent versions... perhaps mentioning this on the list
will helps someone else in the future.

--
Jehiah

On Mon, Dec 15, 2008 at 3:19 AM, Christoph Zwerschke c...@online.de wrote:
 Jehiah Czebotar schrieb:
 Is there a reason that the WebKit/Application.py code (lines 665-705)
 only handles a few specific types of errors, and doesn't enter the
 error handling code for all unknown errors?

 I am working on upgrading to 1.0 and i realized in testing that my
 application logic code that raises a custom error (ie: raise my
 error) will not trigger the user getting an error page as it isn't a
 class that inherits from Exception. This seems different to me than
 the functionality in the previous version i was using.

 The reason is that catching all exceptions would also catch system
 exceptions such as SystemExit and KeyboardInterrupt which we do not want
 the application to handle as normal errors.

 It has been recommended for a long time already that all exceptions
 (that should not be handled at top level) should inherit from Exception.
 This is now even required in Python 3.0. String exceptions such as raise
 my error are even worse, they are already forbidden in Python 2.6.

 I agree with you that Webware 1.0, since it tries to be very backward
 compatible, should also catch other exceptions, but unfortunately,
 nobody ever complained about the new behavior that was already in 0.9.3
 and 0.9.4, so it stayed in 1.0. Anyway, I will fix that in the 1.0
 branch, i.e. catch everything and filter out and reraise the top level
 exceptions manually instead of using the except Exception: idiom.

 But to make your app future-proof I recommend that you replace every
 occurence of raise string in your app with raise Exception(string)
 and let all your exceptions inherit from Exception as the base class.

 -- Christoph


--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel


[Webware-devel] question about how Webware/WebKit handles exceptions

2008-12-14 Thread Jehiah Czebotar
Is there a reason that the WebKit/Application.py code (lines 665-705)
only handles a few specific types of errors, and doesn't enter the
error handling code for all unknown errors?

I am working on upgrading to 1.0 and i realized in testing that my
application logic code that raises a custom error (ie: raise my
error) will not trigger the user getting an error page as it isn't a
class that inherits from Exception. This seems different to me than
the functionality in the previous version i was using.

I would like to see a call to self.handleExceptionInTransaction for
all errors, not just for ones that inherit from exceptions.Exception.

-- 
Jehiah Czebotar

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel


[Webware-devel] namespace collision with inspect.py

2008-07-02 Thread Jehiah Czebotar
in doing some testing for webware-1.0rc1 I realized I had this problem
previously but never mentioned it, or supplied a patch; so here it is.

I have a namespace collision  with MiscUtils/inspect.py because it
gets imported before the default python2.4/inspect.py, and this is
causing problems with another python package we are using. (of course
i have the MiscUtils directory in my path...)

So the easy fix (for me) is to rename MiscUtils/inspect.py to
MiscUtils/ww_inspect.py

and apply this patch

*** WebUtils/cgitb.py   2007-11-23 19:38:33.0 +
--- WebUtils/cgitb.py   2008-07-02 16:59:15.0 +
***
*** 17,19 
  # so we won't use the one that comes with Python 2.1.
! from MiscUtils import inspect

--- 17,19 
  # so we won't use the one that comes with Python 2.1.
! from MiscUtils import ww_inspect


On Fri, Jun 6, 2008 at 3:11 PM, Christoph Zwerschke [EMAIL PROTECTED] wrote:
 ...
 http://downloads.sourceforge.net/webware/Webware-1.0rc1.tar.gz
 or http://downloads.sourceforge.net/webware/Webware-1.0rc1.zip

 ...

 Please download and test, everybody! This is the last chance to get your
 bugfixes in the final 1.0 release. Le me know of any problems or any
 innacurate or outdated information in the accompanying documentation.


-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel


Re: [Webware-devel] namespace collision with inspect.py

2008-07-02 Thread Jehiah Czebotar
 I have a namespace collision  with MiscUtils/inspect.py because it
 gets imported before the default python2.4/inspect.py, and this is
 causing problems with another python package we are using. (of course
 i have the MiscUtils directory in my path...)

 Did you put MiscUtils in the path or is Webware doing this somewhere?

yes i have put  MiscUtils in the path specifically; i don't remember
why at the moment

[time passes]

so I did some investigation and i found a checkin by another developer
that added that to our path back in 2003 so that importing DBPool
didn't need a prefix of 'MiscUtils'. Of course shortly after that
DBPool.py was moved elsewhere in our code tree to account for some
custom modifications, so it didn't matter one way or another, but we
use DBUtils now, so this whole problem might be moot for me if i clean
up some code. (i don't see any other need for MiscUtils directly in my
python path now).

(yes my group at work has been using Webware/WebKit that long)

 So the easy fix (for me) is to rename MiscUtils/inspect.py to
 MiscUtils/ww_inspect.py

 Maybe we should move this and other old modules which are in the stdlib
 now (pydoc, cgitb, Cookie, ...) into a package MiscUtils.StdLib?

 ! from MiscUtils import ww_inspect

 You mean from MiscUtils import ww_inspect as inspect?


right-o; i should try my patches first... i'm still digging through a
few other migration to 1.0rc issues so we'll see how that goes =)

-- 
Jehiah
http://jehiah.cz/

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel


[Webware-devel] NoneType error in PooledDB.__del__

2008-03-13 Thread Jehiah Czebotar
The following bug has been noted before, and I'm including a patch for
it that hopefully someone on this list can apply to trunk for me

The Error is as follows, and happens when a script or program is
shutting down when the PooledDB object is getting cleaned up:

Exception exceptions.TypeError: 'NoneType' object is not callable in
bound method PooledDB.__del__ of DBUtils.PooledDB.PooledDB instance
at 0xb6a7166c ignored

(previous observances)

http://www.mail-archive.com/webware-devel@lists.sourceforge.net/msg02612.html
http://groups.google.co.ve/group/webpy/msg/ed1febae877f6bae

The problem code is in PooledDB:

def __del__(self):
Delete the pool.
if hasattr(self, '_connections'):
self.close()

However in my case _connections = 0, so we need to change it to do this:

def __del__(self):
Delete the pool.
if hasattr(self, '_connections') and self._connections0:
self.close()

This was observed when using cx_Oracle as the database class but i
don't know that it caused this at all because one of the referenced
observances was against mysql

a patch file against trunk is attached.

(Credit for fixing this goes to Susan Anderson our DBA at work who
tracked down the fix)

--
Jehiah


dbutils_nonetype.patch
Description: Binary data
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel