On Dec 15, 2005, at 4:01 PM, Nikko Wolf wrote:
Can you elaborate on what "strange and unpredictable behavior" you
mean? I'm curious in general, but especially w.r.t. the code above?
BTW, a simple grep of sources in Zope (2.7.6-final) turns up 600+
places where a bare except is used, and m
Andreas Jung wrote:
--On 14. Dezember 2005 12:54:56 -0700 Nikko Wolf
<[EMAIL PROTECTED]> wrote:
So you could try this instead:
for item in itemList:
try:
context.afolder.manage_delObjects([item])
except:
continue
Wa... DON'T DO THAT. You should
Jonathan wrote:
Andreas wrote:
My 2 cents: PythonScripts are restricted and are *not* thought to be a full
replacement for Python modules. If you need this functionaltiy consider
writing a Zope Product, using external methods or using TrustedExecutables.
If python scripts are restricted
+---[ Joe Bezier ]--
| On 14 Dec 2005, at 19:54, Nikko Wolf wrote:
| >In general, TTW coding is very limited; you can use External Methods
| >(a.k.a. Extensions) or Products to avoid this.
| >
| Please excuse my ignorance, but what does "TTW coding" mean exactly?
"Through
On 14 Dec 2005, at 19:54, Nikko Wolf wrote:
In general, TTW coding is very limited; you can use External Methods
(a.k.a. Extensions) or Products to avoid this.
Please excuse my ignorance, but what does "TTW coding" mean exactly?
Thanks
JB
__
- Original Message -
From: "Tino Wildenhain" <[EMAIL PROTECTED]>
To: "Andreas Jung" <[EMAIL PROTECTED]>
Cc: "Jonathan" <[EMAIL PROTECTED]>;
Sent: Thursday, December 15, 2005 9:15 AM
Subject: Re: [Zope] Trapping zope exceptions in p
Andreas Jung schrieb:
--On 15. Dezember 2005 09:08:20 -0500 Jonathan <[EMAIL PROTECTED]> wrote:
- Original Message - From: "Tino Wildenhain" <[EMAIL PROTECTED]>
Interesting work-around, but I agree that these exception types should be
immediately available in plain vanilla python scri
--On 15. Dezember 2005 09:08:20 -0500 Jonathan <[EMAIL PROTECTED]> wrote:
- Original Message - From: "Tino Wildenhain" <[EMAIL PROTECTED]>
Interesting work-around, but I agree that these exception types should be
immediately available in plain vanilla python scripts.
Patches + test
- Original Message -
From: "Tino Wildenhain" <[EMAIL PROTECTED]>
To: "Jonathan" <[EMAIL PROTECTED]>;
Sent: Thursday, December 15, 2005 8:48 AM
Subject: Re: [Zope] Trapping zope exceptions in python script
...
Try:
context.afolder.manage_delObject
...
Try:
context.afolder.manage_delObjects(['someitem'])
where 'someitem' does not exist in 'afolder'
works:
try:
context.afolder.manage_adlObjects(['nonexistent'])
except Exception,x:
if 'BadRequest' in repr(x):
print "bad request"
else:
raise x
:-)
(Ok, this _is_ ug
Andreas wrote:
My 2 cents: PythonScripts are restricted and are *not* thought to be a full
replacement for Python modules. If you need this functionaltiy consider
writing a Zope Product, using external methods or using TrustedExecutables.
If python scripts are restricted from accessing zExc
- Original Message -
From: "Tino Wildenhain" <[EMAIL PROTECTED]>
To: "Jonathan" <[EMAIL PROTECTED]>
Cc:
Sent: Thursday, December 15, 2005 8:18 AM
Subject: Re: [Zope] Trapping zope exceptions in python script
Jonathan schrieb:
...
It seems s
Jonathan schrieb:
...
It seems strange that one can, using plain vanilla python scripts, trap
bare 'try/excepts' (and I agree with Andreas that this is not a good
thing to do!) and that one can trap python built-in exceptions, but that
one cannot trap zope exceptions. Why allow python scri
--On 15. Dezember 2005 08:03:22 -0500 Jonathan <[EMAIL PROTECTED]> wrote:
- Original Message - From: "J Cameron Cooper"
It seems strange that one can, using plain vanilla python scripts, trap
bare 'try/excepts' (and I agree with Andreas that this is not a good
thing to do!) and th
- Original Message -
From: "J Cameron Cooper" <[EMAIL PROTECTED]>
To: "Jonathan" <[EMAIL PROTECTED]>
Cc:
Sent: Wednesday, December 14, 2005 4:33 PM
Subject: Re: [Zope] Trapping zope exceptions in python script
Jonathan wrote:
Thanks to everyone for
--On 14. Dezember 2005 16:20:57 -0500 Jonathan <[EMAIL PROTECTED]> wrote:
Thanks to everyone for the feedback... the bottom line seems to be that
you can NOT trap zope exceptions in a python script... which seems a bit
odd.
Nothing is odd. I just told you to avoid *bare* try..excepts..as Ti
Jonathan wrote:
Thanks to everyone for the feedback... the bottom line seems to be that
you can NOT trap zope exceptions in a python script... which seems a bit
odd.
Of course you can. You just are restricted from importing certain
things, which happens to include this class of exception. Pro
Am Mittwoch, den 14.12.2005, 16:20 -0500 schrieb Jonathan:
> Thanks to everyone for the feedback... the bottom line seems to be that you
> can NOT trap zope exceptions in a python script... which seems a bit odd.
>
No, you can. But you should know what you do and
reraise critical (e.g. Conflict
PROTECTED]>;
Sent: Wednesday, December 14, 2005 3:06 PM
Subject: Re: [Zope] Trapping zope exceptions in python script
___
Zope maillist - Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related list
--On 14. Dezember 2005 12:54:56 -0700 Nikko Wolf <[EMAIL PROTECTED]>
wrote:
So you could try this instead:
for item in itemList:
try:
context.afolder.manage_delObjects([item])
except:
continue
Wa... DON'T DO THAT. You should *never* use bare try..ex
Jonathan wrote:
I am trying to catch a 'BadRequest' exception in the following python
script excerpt:
for item in itemList:
try:
context.afolder.manage_delObjects([item])
except BadRequest:
continue
NameError: global name 'BadRequest' is not defined
The following would norma
I am trying to catch a 'BadRequest' exception in the following python script
excerpt:
for item in itemList:
try:
context.afolder.manage_delObjects([item])
except BadRequest:
continue
The rationale behind this is that itemList may contain entries that no
longer exist in 'afolder'
22 matches
Mail list logo