[ZWeb] Problems with /acl_users
Jim Fulton
jim@digicool.com
Tue, 26 Sep 2000 11:02:21 -0400
Shane Hathaway wrote:
>
> On Tue, 26 Sep 2000, Martijn Pieters wrote:
>
> > On Tue, Sep 26, 2000 at 10:05:35AM -0400, Shane Hathaway wrote:
> > > On Tue, 26 Sep 2000, Martijn Pieters wrote:
> > >
> > > > On Tue, Sep 26, 2000 at 09:13:22AM -0400, Shane Hathaway wrote:
> > > > I can't connect to the server, it seems:
> > > >
> > > > INSTANCE_HOME=/usr/local/dc/org python
> > > > ...
> > > > >>> import Zope
> > > > Traceback (innermost last):
> > > > File "<stdin>", line 1, in ?
> > > > File "/usr/local/dc/Zope2/lib/python/Zope/__init__.py", line 118, in ?
> > > > DB=ZODB.DB(DB)
> > > > File "/usr/local/dc/zope_soft/lib/python/ZODB/DB.py", line 155, in __init__
> > > > storage.tpc_begin(t)
> > > > File "/usr/local/dc/zope_soft/lib/python/ZEO/ClientStorage.py", line 457, in tpc_begin
> > > > if not self._connected: raise ClientDisconnected()
> > > > ZEO.ClientStorage.ClientDisconnected
> > >
> > > You may need to have root privileges in order to get access to the socket
> > > file that connects to ZEO.
> >
> > sudo python and I get one step further (os.environ['INSTANCE_HOME'] is
> > correct:
> >
> > >>> import Zope
> > Traceback (innermost last):
> > File "<stdin>", line 1, in ?
> > File "/usr/local/dc/Zope2/lib/python/Zope/__init__.py", line 118, in ?
> > DB=ZODB.DB(DB)
> > File "/usr/local/dc/zope_soft/lib/python/ZODB/DB.py", line 144, in __init__
> > storage.registerDB(self, None)
> > File "/usr/local/dc/zope_soft/lib/python/ZEO/ClientStorage.py", line 193, in registerDB
> > self._startup()
> > File "/usr/local/dc/zope_soft/lib/python/ZEO/ClientStorage.py", line 197, in _startup
> > if not self._call.connect():
> > File "/usr/local/dc/zope_soft/lib/python/ZEO/zrpc.py", line 150, in connect
> > self.aq_parent.notifyConnected(s)
> > File "/usr/local/dc/zope_soft/lib/python/ZEO/ClientStorage.py", line 218, in notifyConnected
> > self._call.finishConnect(s)
> > File "/usr/local/dc/zope_soft/lib/python/ZEO/zrpc.py", line 154, in finishConnect
> > SizedMessageAsyncConnection.__init__(self, s, {})
> > File "/usr/local/dc/Zope2/lib/python/ZEO/smac.py", line 100, in __init__
> > SizedMessageAsyncConnection.inheritedAttribute(
> > TypeError: too many arguments; expected 2, got 3
>
> It is important to import ZServer before Zope. I made precisely the same
> mistake you did. Ethan laughed at me. (grrr...) :-)
BTW, this is due to version skew in asyncore....
A nice way to avoid having to remember this is to import
ZServer in your custom_zodb module.
> >
> > About User.py trying to sort the usernames:
> > > > > It would be possible to fix this by calling list() on the returned set.
> > > >
> > > > This means changing AccessControl/User.py, or implementing an External
> > > > Method version of getUserNames() (and getUsers())
> > >
> > > Yep. What do you think--should we update User.py or change back to a
> > > PersistentMapping?
> >
> > I'll change /usr/local/dc/org/Extensions/Membership.py::MeberFolder. It is
> > the base class for the Zope.org MemberFolder ZClass.
>
> Sounds good. (I'm not sure how to get zope.org to reload the class,
> however, since it's in production mode. You may need to restart.)
If it's an EM,you can go to the edit page and select change.
The EM is always reloaded when it's changed.
> >
> > > > I believe that __getattr__ isn't implemented on BTreeFolder?
> > > > app.Members.mj didn't work.
> > >
> > > Right. There are two kinds of BTreeFolders and Jim wanted the one with
> > > no __getattr__. That meant I had to move all of the DTML methods and
> > > External Methods out of /Members and into the root. :-/
> >
> > Okay. Let's hope then that there is no code counting on __getattr__ being
> > implemented then.
Again, I can live with it implementing __getattr__, especially
if it uses it *after* normal attribute lookup.
There's no need to mess with set/delattr.
In general, I think really big folders should use getitem, since
they really wanted to be treated as collections rather than instances
(wrt subobjects). I think getattr makes sense in this case
for hysterical reasons.
Jim
--
Jim Fulton mailto:jim@digicool.com
Technical Director (888) 344-4332 Python Powered!
Digital Creations http://www.digicool.com http://www.python.org
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission. Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.