Hi, I'm trying to do a batch add of users to the standard acl_users folder. Note quite a total success or total failure just yet. First I made a text file (usr_pwd.txt) in the form of password space username. and placed it (temporarily) in the Extensions directory. Then an external method (LoadUsers) to read it: def LoadUsers(self): f=open('/var/lib/zope/Extensions/usr_pwd.txt', 'r') y=f.readlines() return y And a script (user_load): ## Script (Python) "user_load" ##bind container=container ##bind context=context ##bind namespace=_ ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## y=context.LoadUsers() for x in y: z=x.split(' ') acl = container.restrictedTraverse( '/foobar/acl_users' ) acl.userFolderAddUser( z[1], z[0], '', '' ) return 0 I hit the Test tab and now I have an acl_users folder full of users with the correct user names, and their passwords show the correct number of characters, however I can't log in using any of the user/password combinations. Should the path '/foobar/acl_users' been simply '/foobar/' or '/foobar' ? Any suggestions? Thanks, Sean
readlines returns also the terminating \n. you have to strip it hth rr Sean Duffy wrote:
Hi,
I'm trying to do a batch add of users to the standard acl_users folder.
Note quite a total success or total failure just yet.
First I made a text file (usr_pwd.txt) in the form of password space username. and placed it (temporarily) in the Extensions directory.
Then an external method (LoadUsers) to read it:
def LoadUsers(self):
f=open('/var/lib/zope/Extensions/usr_pwd.txt', 'r') y=f.readlines() return y
And a script (user_load):
## Script (Python) "user_load" ##bind container=container ##bind context=context ##bind namespace=_ ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## y=context.LoadUsers() for x in y: z=x.split(' ') acl = container.restrictedTraverse( '/foobar/acl_users' ) acl.userFolderAddUser( z[1], z[0], '', '' ) return 0
I hit the Test tab and now I have an acl_users folder full of users with the correct user names, and their passwords show the correct number of characters, however I can't log in using any of the user/password combinations.
Should the path '/foobar/acl_users' been simply '/foobar/' or '/foobar' ?
Any suggestions?
Thanks,
Sean
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Aloha, I have just attempted my first zope install using a python built from source and am getting an error traceback ending with: undefined symbol: PyUnicodeUCS2_AsEncodedString ...when I try to start zope (full traceback at end of msg). The story: I need to get a zope 2.8.8 up and running on debian Etch (4.0) and python 2.3.x is not available as debian package on Etch. So... I got the python 2.3.6 tarball from python.org, followed the build instructions and amazingly enough got it built and installed. I already have python 2.4 so I made sure to put 2.3 in its' own path. Then I got zope 2.8.8 tarball and built that, using the '--with-python=' option to specify my python 2.3 installation (/usr/local/bin/python2.3 FWIW). The zope build seemed to complete fine also. However when trying to start zope 2.8.8 I get the undefined symbol error. The most relevant info I could google up is here: http://www.gossamer-threads.com/lists/zope/users/208596 I get that there may be some issue with the two build processes and something called UCS4 vs. UCS2 mixed up somehow. The rest, like how that happened and/or how to fix it, is way over my head. Can anyone clarify the UCS2/UCS4 issue and how to resolve it? thanks, John S. -- John Schinnerer, MA WSD ------------------------------------------ - Eco-Living - Whole Systems Design Services People - Place - Learning - Integration john@eco-living.net http://eco-living.net
Apologies, forgot to paste in the full traceback, here it is. FWIW I also have zope 2.9.7 installed from source and working just fine on this same machine (using python 2.4.4 packaged with Etch). Traceback (most recent call last): File "/var/lib/zope2.8.8/lib/python/Zope2/Startup/zopectl.py", line 322, in ? main() File "/var/lib/zope2.8.8/lib/python/Zope2/Startup/zopectl.py", line 280, in main options.realize(args) File "/var/lib/zope2.8.8/lib/python/Zope2/Startup/zopectl.py", line 91, in realize ZDOptions.realize(self, *args, **kw) File "/var/lib/zope2.8.8/lib/python/zdaemon/zdoptions.py", line 273, in realize self.load_schema() File "/var/lib/zope2.8.8/lib/python/zdaemon/zdoptions.py", line 321, in load_schema self.schema = ZConfig.loadSchema(self.schemafile) File "/var/lib/zope2.8.8/lib/python/ZConfig/loader.py", line 31, in loadSchema return SchemaLoader().loadURL(url) File "/var/lib/zope2.8.8/lib/python/ZConfig/loader.py", line 65, in loadURL return self.loadResource(r) File "/var/lib/zope2.8.8/lib/python/ZConfig/loader.py", line 159, in loadResource schema = ZConfig.schema.parseResource(resource, self) File "/var/lib/zope2.8.8/lib/python/ZConfig/schema.py", line 27, in parseResource xml.sax.parse(resource.file, parser) File "/var/lib/zope2.8.8/lib/python/Zope2/Startup/__init__.py", line 33, in parse check_python_version() File "xml/sax/expatreader.py", line 107, in parse File "xml/sax/xmlreader.py", line 123, in parse File "xml/sax/expatreader.py", line 207, in feed File "xml/sax/expatreader.py", line 300, in start_element File "/var/lib/zope2.8.8/lib/python/ZConfig/schema.py", line 99, in startElement getattr(self, "start_" + name)(attrs) File "/var/lib/zope2.8.8/lib/python/ZConfig/schema.py", line 475, in start_schema keytype, valuetype, datatype = self.get_sect_typeinfo(attrs) File "/var/lib/zope2.8.8/lib/python/ZConfig/schema.py", line 201, in get_sect_typeinfo datatype = self.get_datatype(attrs, "datatype", "null", base) File "/var/lib/zope2.8.8/lib/python/ZConfig/schema.py", line 194, in get_datatype return self._registry.get(dtname) File "/var/lib/zope2.8.8/lib/python/ZConfig/datatypes.py", line 398, in get t = self.search(name) File "/var/lib/zope2.8.8/lib/python/ZConfig/datatypes.py", line 423, in search package = __import__(n, g, g, component) File "/var/lib/zope2.8.8/lib/python/Zope2/Startup/datatypes.py", line 20, in ? from ZODB.config import ZODBDatabase File "/var/lib/zope2.8.8/lib/python/ZODB/__init__.py", line 21, in ? from persistent import TimeStamp File "/var/lib/zope2.8.8/lib/python/persistent/__init__.py", line 19, in ? from cPersistence import Persistent, GHOST, UPTODATE, CHANGED, STICKY ImportError: /var/lib/zope2.8.8/lib/python/persistent/cPersistence.so: undefined symbol: PyUnicodeUCS2_AsEncodedString John Schinnerer wrote:
Aloha,
I have just attempted my first zope install using a python built from source and am getting an error traceback ending with:
undefined symbol: PyUnicodeUCS2_AsEncodedString
...when I try to start zope (full traceback at end of msg).
The story: I need to get a zope 2.8.8 up and running on debian Etch (4.0) and python 2.3.x is not available as debian package on Etch. So...
I got the python 2.3.6 tarball from python.org, followed the build instructions and amazingly enough got it built and installed. I already have python 2.4 so I made sure to put 2.3 in its' own path.
Then I got zope 2.8.8 tarball and built that, using the '--with-python=' option to specify my python 2.3 installation (/usr/local/bin/python2.3 FWIW).
The zope build seemed to complete fine also. However when trying to start zope 2.8.8 I get the undefined symbol error. The most relevant info I could google up is here: http://www.gossamer-threads.com/lists/zope/users/208596
I get that there may be some issue with the two build processes and something called UCS4 vs. UCS2 mixed up somehow. The rest, like how that happened and/or how to fix it, is way over my head.
Can anyone clarify the UCS2/UCS4 issue and how to resolve it?
thanks, John S.
-- John Schinnerer, MA WSD ------------------------------------------ - Eco-Living - Whole Systems Design Services People - Place - Learning - Integration john@eco-living.net http://eco-living.net
--On 20. Juni 2007 21:03:20 -1000 John Schinnerer <john@eco-living.net> wrote:
Aloha,
I have just attempted my first zope install using a python built from source and am getting an error traceback ending with:
undefined symbol: PyUnicodeUCS2_AsEncodedString
...when I try to start zope (full traceback at end of msg).
The story: I need to get a zope 2.8.8 up and running on debian Etch (4.0) and python 2.3.x is not available as debian package on Etch. So...
I got the python 2.3.6 tarball from python.org, followed the build instructions and amazingly enough got it built and installed. I already have python 2.4 so I made sure to put 2.3 in its' own path.
Then I got zope 2.8.8 tarball and built that, using the '--with-python=' option to specify my python 2.3 installation (/usr/local/bin/python2.3 FWIW).
The zope build seemed to complete fine also. However when trying to start zope 2.8.8 I get the undefined symbol error. The most relevant info I could google up is here: http://www.gossamer-threads.com/lists/zope/users/208596
I get that there may be some issue with the two build processes and something called UCS4 vs. UCS2 mixed up somehow. The rest, like how that happened and/or how to fix it, is way over my head.
Can anyone clarify the UCS2/UCS4 issue and how to resolve it?
You have definitely some Python module somewhere in our sys.path or PYTHONPATH compiled against a different Python version....trible check that. -aj
Andreas Jung wrote:
--On 20. Juni 2007 21:03:20 -1000 John Schinnerer <john@eco-living.net> wrote:
Aloha,
I have just attempted my first zope install using a python built from source and am getting an error traceback ending with:
undefined symbol: PyUnicodeUCS2_AsEncodedString
...when I try to start zope (full traceback at end of msg).
The story: I need to get a zope 2.8.8 up and running on debian Etch (4.0) and python 2.3.x is not available as debian package on Etch. So...
I got the python 2.3.6 tarball from python.org, followed the build instructions and amazingly enough got it built and installed. I already have python 2.4 so I made sure to put 2.3 in its' own path.
Then I got zope 2.8.8 tarball and built that, using the '--with-python=' option to specify my python 2.3 installation (/usr/local/bin/python2.3 FWIW).
The zope build seemed to complete fine also. However when trying to start zope 2.8.8 I get the undefined symbol error. The most relevant info I could google up is here: http://www.gossamer-threads.com/lists/zope/users/208596
I get that there may be some issue with the two build processes and something called UCS4 vs. UCS2 mixed up somehow. The rest, like how that happened and/or how to fix it, is way over my head.
Can anyone clarify the UCS2/UCS4 issue and how to resolve it?
You have definitely some Python module somewhere in our sys.path or PYTHONPATH compiled against a different Python version....trible check that.
Thanks...I have no idea how to do that unfortunately. This is the first time I've built python from source. I just followed the build instructions in the tarball and "it worked." At least, I have a working python 2.3 in the location I specified for "--with-python" when building zope. From various list messages about this same error message I get that there is some mismatch involving UCS2 vs. UCS4 compiled pieces - if I grok correctly...? I have no idea what controls that and saw nothing about it in the python or zope build docs. I previously had zope 2.8.8 running on debian Sarge with the packaged python 2.3 no problem. So...onwards...somehow... John S. -- John Schinnerer, MA WSD ------------------------------------------ - Eco-Living - Whole Systems Design Services People - Place - Learning - Integration john@eco-living.net http://eco-living.net
--On 20. Juni 2007 21:58:18 -1000 John Schinnerer <john@eco-living.net> wrote:
Thanks...I have no idea how to do that unfortunately. This is the first time I've built python from source. I just followed the build instructions in the tarball and "it worked." At least, I have a working python 2.3 in the location I specified for "--with-python" when building zope. From various list messages about this same error message I get that there is some mismatch involving UCS2 vs. UCS4 compiled pieces - if I grok correctly...?
Right. If you install Python using configure --prefix=/opt/python-2.4; make;make install and configure Zope using configure --with-python=/opt/python-2.4/bin/python2.4; make; make install you should never get into such trouble. Somehow your environment or setup must be broken. Possibly you're installing Zope over an existing Zope installation with possibly old zopectl/runzope files inside the 'bin' folder which won't be replaced by "make install". So check the "python" configuration within your bin/zopectl|runzope files. -aj
Andreas Jung wrote:
--On 20. Juni 2007 21:58:18 -1000 John Schinnerer <john@eco-living.net> wrote:
Thanks...I have no idea how to do that unfortunately. This is the first time I've built python from source. I just followed the build instructions in the tarball and "it worked." At least, I have a working python 2.3 in the location I specified for "--with-python" when building zope. From various list messages about this same error message I get that there is some mismatch involving UCS2 vs. UCS4 compiled pieces - if I grok correctly...?
Right.
If you install Python using
configure --prefix=/opt/python-2.4; make;make install
and configure Zope using
configure --with-python=/opt/python-2.4/bin/python2.4; make; make install
you should never get into such trouble. Somehow your environment or setup must be broken. Possibly you're installing Zope over an existing Zope installation with possibly old zopectl/runzope files inside the 'bin' folder which won't be replaced by "make install". So check the "python" configuration within your bin/zopectl|runzope files.
Thanks again - the above is what I thought I did (matching the --prefix and the --with-python) - however somewhere I blew it somehow as the control files point to the wrong python. I'll try again and hopefully get it right. Thanks for the extra assist. cheers, John S. -- John Schinnerer, MA WSD ------------------------------------------ - Eco-Living - Whole Systems Design Services People - Place - Learning - Integration john@eco-living.net http://eco-living.net
John Schinnerer wrote:
Andreas Jung wrote:
--On 20. Juni 2007 21:58:18 -1000 John Schinnerer <john@eco-living.net> wrote:
Thanks...I have no idea how to do that unfortunately. This is the first time I've built python from source. I just followed the build instructions in the tarball and "it worked." At least, I have a working python 2.3 in the location I specified for "--with-python" when building zope. From various list messages about this same error message I get that there is some mismatch involving UCS2 vs. UCS4 compiled pieces - if I grok correctly...?
Right.
If you install Python using
configure --prefix=/opt/python-2.4; make;make install
and configure Zope using
configure --with-python=/opt/python-2.4/bin/python2.4; make; make install
you should never get into such trouble. Somehow your environment or setup must be broken. Possibly you're installing Zope over an existing Zope installation with possibly old zopectl/runzope files inside the 'bin' folder which won't be replaced by "make install". So check the "python" configuration within your bin/zopectl|runzope files.
Thanks again - the above is what I thought I did (matching the --prefix and the --with-python) - however somewhere I blew it somehow as the control files point to the wrong python. I'll try again and hopefully get it right. Thanks for the extra assist.
Well, I'm not crazy. I just rebuilt it all and triple checked that I gave the matching --with-python when configuring the zope build. I did. And, it did not get used...the zopectl and runzope files were created with the default path (to the wrong python) anyhow! So I fixed that manually, and now (after fixing some perms issues) it starts up OK. thanks again, John S. -- John Schinnerer, MA WSD ------------------------------------------ - Eco-Living - Whole Systems Design Services People - Place - Learning - Integration john@eco-living.net http://eco-living.net
participants (4)
-
Andreas Jung -
John Schinnerer -
robert rottermann -
Sean Duffy