Re: [Zope-dev] RDB connections and cursors

2002-11-19 Thread Dieter Maurer
Leonardo Rochael Almeida writes:
 > ...
 > Assuming my reasoning above is correct we should be able to create a
 > single connection and a single cursor on __setstate__ of the DA
 > connector instance of the ZODB. The transaction boundaries would be
 > handled normally, but since a worker thread only handles one request at
 > a time, there's no need to close the cursor nor the connection at the
 > transaction end.
Isn't this precisely how most existing DA's work?


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] Problem with Zope 2.6.0 and ZShell

2002-11-19 Thread Guido van Rossum
> On Tue, Nov 19, 2002 at 01:54:56PM -0500, Guido van Rossum wrote:
> > 
> > > Since I don't actually use Zope 2.6, does anyone have an idea on 
> > > where the problem may come from ?
> > 
> > You're using restricted mode (the rexec module) and this apparently
> > doesn't provide sys.hexversion.  This is a shallow bug; it's already
> > fixed in Python 2.3 (CVS).
> > ... 
> > Probably those versions of Python didn't have the test for
> > sys.hexversion; it's testing whether this is Python 2.2 or higher.
> > 
> > A workaround would be to set sys.hexversion to 0x0202 (or to 0 if
> > you're not sure which Python version you're using) before importing
> > sre for the first time.
> 
> Thanks for your answer.
> 
> Unfortunately I never import sre.
> 
> I import re, then rexec in the main program, 
> then in the restricted code I add the 
> os and os.path modules, and the resticted code
> then import the glob modules and calls its glob
> method.
> 
> So should I set sys.hexversion *before* my re and rexec
> imports in the main program, or add the sys module and
> a fake hexversion value in the restricted code ?

In the restricted code, right at the start.  Restricted code loads its
own copy of each module it uses.  The glob module uses re, which uses
sre.

--Guido van Rossum (home page: http://www.python.org/~guido/)

___
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] Problem with Zope 2.6.0 and ZShell

2002-11-19 Thread Jerome Alet
Hi,

On Tue, Nov 19, 2002 at 01:54:56PM -0500, Guido van Rossum wrote:
> 
> > Since I don't actually use Zope 2.6, does anyone have an idea on 
> > where the problem may come from ?
> 
> You're using restricted mode (the rexec module) and this apparently
> doesn't provide sys.hexversion.  This is a shallow bug; it's already
> fixed in Python 2.3 (CVS).
> ... 
> Probably those versions of Python didn't have the test for
> sys.hexversion; it's testing whether this is Python 2.2 or higher.
> 
> A workaround would be to set sys.hexversion to 0x0202 (or to 0 if
> you're not sure which Python version you're using) before importing
> sre for the first time.

Thanks for your answer.

Unfortunately I never import sre.

I import re, then rexec in the main program, 
then in the restricted code I add the 
os and os.path modules, and the resticted code
then import the glob modules and calls its glob
method.

So should I set sys.hexversion *before* my re and rexec
imports in the main program, or add the sys module and
a fake hexversion value in the restricted code ?

thanks in advance

Jerome Alet

___
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] Problem with Zope 2.6.0 and ZShell

2002-11-19 Thread Guido van Rossum
>   Module sre, line 168, in ?
> AttributeError: 'module' object has no attribute 'hexversion'
> *
> 
> This seems to be deep in Python standard library.

Not that deep actually.  sre.py line 168 is this:

if sys.hexversion >= 0x0202:

> Since I don't actually use Zope 2.6, does anyone have an idea on 
> where the problem may come from ?

You're using restricted mode (the rexec module) and this apparently
doesn't provide sys.hexversion.  This is a shallow bug; it's already
fixed in Python 2.3 (CVS).

> Does any of you use ZShell with Zope 2.6 ?
> 
> It works fine in 2.5.1 with Python 2.1.3, so something has
> changed somewhere which breaks it.

Probably those versions of Python didn't have the test for
sys.hexversion; it's testing whether this is Python 2.2 or higher.

A workaround would be to set sys.hexversion to 0x0202 (or to 0 if
you're not sure which Python version you're using) before importing
sre for the first time.

--Guido van Rossum (home page: http://www.python.org/~guido/)

___
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] CMF, CMFCore/utils.py, Tuple/List incompatibility

2002-11-19 Thread Florent Guillaume
I had the same problem once. It turned out that I had called
manage_setLocalRoles with a tuple instead of a list, but as you found
out some code expects all local roles to be stored as the same sequence
type, and Role.manage_addLocalRoles enforces the invariant that a
changed role is stored as a list.

I think manage_setLocalRoles should be changed to enforce that
invariant.

Florent

Christian Theune  <[EMAIL PROTECTED]> wrote:
> Hi.
> 
> I get smacked by this:
> 
> [...long traceback...]
> 
> * Module Products.CMFCore.CatalogTool, line 58, in allowedRolesAndUsers
> * Module Products.CMFCore.utils, line 200, in _mergedLocalRoles
> 
> Exception Value  can only concatenate tuple (not "list") to tuple
> 
> The file tells me nothing special. I once fixed it by using 
> 
> merged[k] = tuple(merged[k]) + tuple(v)
> 
> instead of
> 
> 
> merged[k] = merged[k] + v
> 
> I don't know if i triggered something bad before, but this code seems to
> be somewhat ... instable ... so maybe forcing it into a tuple maybe a
> good thing.
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:[EMAIL PROTECTED]

___
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] Problem with Zope 2.6.0 and ZShell

2002-11-19 Thread Jerome Alet
Hi,

Someone has reported to me a problem when running ZShell's latest 
version (1.5) under Zope 2.6 CVS and Python 2.2.2

Here's the traceback :

*
Traceback (innermost last):
  Module ZPublisher.Publish, line 98, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 39, in call_object
  Module Products.ExternalMethod.ExternalMethod, line 224, in __call__
   - __traceback_info__: ((, ['man ls', 
'ls'], None), {}, (None, None))
  Module /home/zope/Zope/ZInstanceHome/Extensions/zshell.py, line 3501, 
in zshell
  Module /home/zope/Zope/ZInstanceHome/Extensions/zshell.py, line 701, 
in __init__
  Module /home/zope/Zope/ZInstanceHome/Extensions/zshell.py, line 1014, 
in execCommands
  Module /home/zope/Zope/ZInstanceHome/Extensions/zshell.py, line 1081, 
in execCommand
  Module /home/zope/Zope/ZInstanceHome/Extensions/zshell.py, line 891, 
in ShellExpand
  Module rexec, line 429, in s_exec
  Module rexec, line 412, in s_apply
  Module rexec, line 308, in r_exec
  Module __main__, line 1, in ?
  Module rexec, line 339, in r_import
  Module ihooks, line 397, in import_module
  Module ihooks, line 433, in find_head_package
  Module ihooks, line 486, in import_it
  Module ihooks, line 325, in load_module
  Module glob, line 4, in ?
  Module rexec, line 339, in r_import
  Module ihooks, line 397, in import_module
  Module ihooks, line 433, in find_head_package
  Module ihooks, line 486, in import_it
  Module ihooks, line 325, in load_module
  Module fnmatch, line 13, in ?
  Module rexec, line 339, in r_import
  Module ihooks, line 397, in import_module
  Module ihooks, line 433, in find_head_package
  Module ihooks, line 486, in import_it
  Module ihooks, line 325, in load_module
  Module re, line 27, in ?
  Module rexec, line 339, in r_import
  Module ihooks, line 397, in import_module
  Module ihooks, line 433, in find_head_package
  Module ihooks, line 486, in import_it
  Module ihooks, line 325, in load_module
  Module sre, line 168, in ?
AttributeError: 'module' object has no attribute 'hexversion'
*

This seems to be deep in Python standard library.

Since I don't actually use Zope 2.6, does anyone have an idea on 
where the problem may come from ?

Does any of you use ZShell with Zope 2.6 ?

It works fine in 2.5.1 with Python 2.1.3, so something has
changed somewhere which breaks it.

ZShell's latest version is available from :

http://www.librelogiciel.com/software

Thanks in advance for any pointer.

Jerome Alet

___
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] Fwd: RE: [Zope] import error - No module named iclass

2002-11-19 Thread JĂșlio Silva


> >I'm upgrading to zope 2.6.0.
> >When I try to import a ZClass based Product from zope 2.5.1
> i get the
> >following error.
> >
> >Error Type: ImportError
> >Error Value: No module named iclass

> Yup.  This was discussed about a week ago. Search the mailing
> list archives; but as I remember, only the ZClasses descended
> from ObjectManager have the problem, and then only if there
> is a non-empty list on the SubObjects tab.  To export from
> 2.5.x, remove all from that list; then it will import fine
> into 2.6.  Then, I presume that you can recreate the list of
> allowed subobjects, though I have not tried this.

This worked fine.
Thanks.



Hi,

I'm having the same problem migrating a zclass from 2.5.1 to 2.6.
I've tryed the collector fix of ZClasses/ObjectManager.py and the 
subobjects tab thing, but
that didnt solved my problem.

My zclass has ZFolder as base class instead of ObjectManager:

Base Classes: ZObject, ZFolder, CatalogAwareBase

I'm looking at the ObjectManager.py to see if I can put it to work for my 
zclass, but
I think in my case that doesnt make sense because my class dont have a 
subobject tab...

I'm looking into the zen of iclass...

Any ideias? thanks.

Regards,
Julio Silva


I'm forwarding this mail to zope-dev because since this is related with 
2.6.0 development changes
against 2.5.1 maybe someone has other solutions, because the that is out 
there for ObjectManager
doesnt solve my problem.

Best Regards,
Julio Silva

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.416 / Virus Database: 232 - Release Date: 11/6/2002