Re: [Zope-dev] exceptions on windows

2001-09-16 Thread Chris Withers

 However, I checked that in Python2.1 (at least) there is not
 exceptions module.

How strange, I've been doing a _lot_ of:

from exceptions import Exception

over the last week in Python 2.1.1 and it works fine for me :-S

Confusedly,

Chris


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] exceptions on windows

2001-09-16 Thread Dieter Maurer

Chris Withers writes:
   However, I checked that in Python2.1 (at least) there is not
   exceptions module.
  
  How strange, I've been doing a _lot_ of:
  
  from exceptions import Exception
It's built in. I looked in the file system


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] exceptions on windows

2001-09-15 Thread Dieter Maurer

Andy McKay writes:
  Wild guess... theres a module /lib/python/Interface/Exceptions.py. In Python
  1.5.2 doesnt that mean windows will import that rather than exceptions.py?
Only when you happen to be inside the Interface package...
Anywhere else, it should find exceptions.

However, I checked that in Python2.1 (at least) there is not
exceptions module.
SyntaxError (and friends) are defined in __builtins__
and can be accessed directly.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] exceptions on windows

2001-09-14 Thread kapil thangavelu

i've always been curious why zope on windows with 
a bundled python seems to have problems with finding
the standard lib exceptions. does anyone know why?

for example 

from exceptions import SyntaxError

class MySyntaxErr(SyntaxError):
pass

in a product generates an import error.

(i last noted this behavior on 2.2, haven't used windows since...)


thanks

-kapil

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] exceptions on windows

2001-09-14 Thread Andy McKay

Wild guess... theres a module /lib/python/Interface/Exceptions.py. In Python
1.5.2 doesnt that mean windows will import that rather than exceptions.py?

Cheers.
--
  Andy McKay.


- Original Message -
From: kapil thangavelu [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 14, 2001 4:57 AM
Subject: [Zope-dev] exceptions on windows


 i've always been curious why zope on windows with
 a bundled python seems to have problems with finding
 the standard lib exceptions. does anyone know why?

 for example

 from exceptions import SyntaxError

 class MySyntaxErr(SyntaxError):
 pass

 in a product generates an import error.

 (i last noted this behavior on 2.2, haven't used windows since...)


 thanks

 -kapil

 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Exceptions

2000-11-12 Thread Jim Fulton


I think that this would make a great dev.zope.org fish-bowl project.

I'd love to see someone come up with an exception model for
Zope:

  - arranging exceptions in a hierarchy.

  - defining standard APIs for exceptions.

To give an example of what I'd like to gain by having
exception APIs, I'd like there to be ab API for
finding out whether an exception is meant for a human
and getting an exception as HTML, so we stop embedding
markup in exception values to indicate errors meant 
for humans.

Any volunteers? :)

Jim

seb bacon wrote:
 
 I was just building in some error handling into some UI code, and wanted to catch 
errors relating to duplicate ids.  The problem is that just about every client-side 
error raises the same kind of Exception, a 'Bad Request'.  A quick grep counted 41 
different types of 'Bad Request' in my Zope source.
 
 Wouldn't it be *much* nicer to have a hierarchy of exception types, so that 
applications can deal with them at an arbitrarily granular level?  e.g.
 
 ZopeException
 |
 `RequestException
   |  |
   |  `XMLException
   |
   `IdException
 |  |
 |  `ReservedWordException
 |
 `DuplicateException
 
 Has this discussion taken place before?  Would it be useful?  Would its 
effort:benfits ratio be too great to justify doing?
 
 seb
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Exceptions

2000-11-10 Thread seb bacon

I was just building in some error handling into some UI code, and wanted to catch 
errors relating to duplicate ids.  The problem is that just about every client-side 
error raises the same kind of Exception, a 'Bad Request'.  A quick grep counted 41 
different types of 'Bad Request' in my Zope source.

Wouldn't it be *much* nicer to have a hierarchy of exception types, so that 
applications can deal with them at an arbitrarily granular level?  e.g.

ZopeException
|
`RequestException
  |  |
  |  `XMLException
  |
  `IdException
|  |
|  `ReservedWordException
|
`DuplicateException

Has this discussion taken place before?  Would it be useful?  Would its effort:benfits 
ratio be too great to justify doing?

seb

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Exceptions

2000-11-10 Thread Chris Withers

Oh if only!!!

I love this idea, and comments haev coem from DC along those same lines,
btu nothing ever really happened about it...

cheers,

Chris

seb bacon wrote:
 
 I was just building in some error handling into some UI code, and wanted to catch 
errors relating to duplicate ids.  The problem is that just about every client-side 
error raises the same kind of Exception, a 'Bad Request'.  A quick grep counted 41 
different types of 'Bad Request' in my Zope source.
 
 Wouldn't it be *much* nicer to have a hierarchy of exception types, so that 
applications can deal with them at an arbitrarily granular level?  e.g.
 
 ZopeException
 |
 `RequestException
   |  |
   |  `XMLException
   |
   `IdException
 |  |
 |  `ReservedWordException
 |
 `DuplicateException
 
 Has this discussion taken place before?  Would it be useful?  Would its 
effort:benfits ratio be too great to justify doing?
 
 seb
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




RE: [Zope-dev] Exceptions

2000-11-10 Thread Brian Lloyd


 snip good idea about exception hierarchies

 Oh if only!!!
 
 I love this idea, and comments haev coem from DC along those same lines,
 btu nothing ever really happened about it...

If there are people willing to work on this, then a proposal 
would be most welcome...

http://dev.zope.org/Wikis/DevSite/Proposals/FrontPage



Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909  
Digital Creations  http://www.digicool.com 





___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )