Re: [Zope] Zope/Editor problems
You don't give enough informations (logs, tracebacks etc) for us to help you. The problem is that nothing is written in the logs. In the Epoz case, Zope just crashes during startup. And in the Kupu case I get the errors when I click on any of the tabs in the editor object. I have installed a new 2.8.3 instance and installed Epoz 2.0.1 in that. Zope still crashes without any logs or traces (I put both on them on 'all' for this). ___ 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 )
Re: [Zope] Zope/Editor problems
On 10/26/05, Håkan Johansson [EMAIL PROTECTED] wrote: You don't give enough informations (logs, tracebacks etc) for us to help you. The problem is that nothing is written in the logs. In the Epoz case, Zope just crashes during startup. It crashes, without any error messages? Really? Have you turned on debug mode? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ 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 )
Re: [Zope] Zope/Editor problems
On Oct 26, 2005, at 13:31, Lennart Regebro wrote: On 10/26/05, Håkan Johansson [EMAIL PROTECTED] wrote: You don't give enough informations (logs, tracebacks etc) for us to help you. The problem is that nothing is written in the logs. In the Epoz case, Zope just crashes during startup. It crashes, without any error messages? Really? Have you turned on debug mode? Yes, debug mode is on. My personal guess is that both Epoz and Kupu has hidden prereqs that the documentation does not say, or that I simply missed somehow. With my old installation that has Plone installed (but not used), Zope can start with Kupu installed, but the bare bones installation crashes during startup if that is installed. My $INSTANCE_HOME/Products dir contains the following (before trying with editors): * LocalFS * TextIndexNG2 * README.txt ___ 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 )
Re: [Zope] REQUEST.form variables order
Krzysztof Kubacki schrieb: On 24 Oct 2005, at 14:03, Krzysztof Kubacki wrote: How to change it? I would like to have variables in the same order as I put them into internet form. You can't. REQUEST.form is a dictionary. They are, by definition, unordered. Why do you need them ordered? What is the use case? In my Send script I collect all data from internet form and send to email. I want to have that data in the email in the same order it was placed in the internet form. Please keep this on the list! You'll have to add code to your script to order the form items yourself. But the thing is that I don't have guarantee that user will not replace fields in the internet form(there is a possibility). And how exactly would that help if your script isnt expecting the new fields anyway? I'd use the :list and :records modifier accordingly for keeping ordering where that matters. The thing is that there is possibility to change fields order by the mean of WYSIWYG editor by the user. If he change order I would expect to get the same order in REQUEST object. Regards Krzychu ___ 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 )
Re: [Zope] REQUEST.form variables order
... And how exactly would that help if your script isnt expecting the new fields anyway? I'd use the :list and :records modifier accordingly for keeping ordering where that matters. The thing is that there is possibility to change fields order by the mean of WYSIWYG editor by the user. If he change order I would expect to get the same order in REQUEST object. You cant. If you need to maintain order of fields, use :list or :records e.g. input type=text name=field:list / input type=text name=field:list / and so on. Then you get a list for field and the elements are in the expected order. You might read on that matter a bit: http://zopewiki.org/ZPublisher ___ 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 )
[Zope] Re: Filesystem Page Template lowercase-ifying all my tags
An update - It appears as though this problem is due to the content-type being set inappropriately (probably text/html). I'm attempting to render XML, but each of the templates only contains a piece of my final output XML file; therefore, I don't have the '?xml ... ?' header in the file. From a perusal of the source for FSPageTemplate, this appears to be the only way to get the Content-Type set to 'text/xml'. Basically, I'm constructing a VERY large XML file using a python script that buffers writes to REQUEST.RESPONSE. The script calls the page templates, and then writes the rendered page templates to REQUEST.RESPONSE through the buffering mechanism. I have attempted adding .metadata files for each of my templates, with the following content: ---8-- [default] content_type=text/xml ---8-- It didn't work. I'm still at a loss for how to make this all happen, I can't have my XML tags get lower-case-ified. Please help! Zope 2.7.7-final, python 2.3.5, freebsd5 Page Templates 1.4.0 CMF 1.4.8 fm On 10/25/05, Floyd May [EMAIL PROTECTED] wrote: I have a product that installs some filesystem page templates into a plone site's portal_skins. The templates are exactly the same as their created-through-ZMI counterparts, yet the filesystem templates render with all their tags lower-cased, whereas the ZMI-created templates preserve case. Why is this happening? Zope 2.7.7-final, python 2.3.5, freebsd5 Page Templates 1.4.0 Thanks! fm ___ 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 )
Re: [Zope] Re: Filesystem Page Template lowercase-ifying all my tags
On 10/26/05, Floyd May [EMAIL PROTECTED] wrote: It appears as though this problem is due to the content-type being set inappropriately (probably text/html). I'm attempting to render XML, but each of the templates only contains a piece of my final output XML file; therefore, I don't have the '?xml ... ?' header in the file. From a perusal of the source for FSPageTemplate, this appears to be the only way to get the Content-Type set to 'text/xml'. Basically, Unfortunately, that's true for the current code. Julien Anguenot and I started working on this problem (along with some other aspects of the XML vs. HTML behavior) based on the Zope 3 implementation for page templates. The work isn't done yet, though the aspect you're interested in is pretty straightforward. That's only for the Zope 3 version of the code, however. For now, your best bet may be to subclass the PageTemplateFile class (or whichever derived class of that that's relevant to you) and override the _cook_check() method to do what you need it to do. If you're using a file-system view, you likely need to arrange for your new class to be used for some new filename extension; I'm not sure how to arrange for that. -Fred -- Fred L. Drake, Jr.fdrake at gmail.com Society attacks early, when the individual is helpless. --B.F. Skinner ___ 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 )
Re: [Zope] Re: Filesystem Page Template lowercase-ifying all my tags
Floyd May wrote: I'm constructing a VERY large XML file using a python script that buffers writes to REQUEST.RESPONSE. The script calls the page templates, and then writes the rendered page templates to REQUEST.RESPONSE through the buffering mechanism. I have attempted adding .metadata files for each of my templates, with the following content: ---8-- [default] content_type=text/xml ---8-- It didn't work. I'm still at a loss for how to make this all happen, I can't have my XML tags get lower-case-ified. Please help! Zope 2.7.7-final, python 2.3.5, freebsd5 Page Templates 1.4.0 CMF 1.4.8 Yes, it's a bug in CMF 1.4's parsing of FSPageTemplates that stomps on the content type and sets it back to text/html every time. Can you upgrade to CMF 1.5? cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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 )
Re: [Zope] Re: Filesystem Page Template lowercase-ifying all my tags
I found a way to hack around it. It's definitely ugly, though. Basically, I have a python script that calls page templates and buffers the results as it writes out to REQUEST.RESPONSE. Each page template is *just a portion* of my final output XML file. Since all of the scripts and templates that I'm using are read from the filesystem, they are the filesystem-equivalents to the ZODB-stored objects. Specifically, I discovered that the FSPageTemplate from CMFCore will set the content_type attribute on the object to 'text/xml' if the file begins with '?xml'. Otherwise, when it sees the xml-or-html-looking content, it assumes a content_type of 'text/html', which lowercases all the tags. So I added an xml header to all of my page templates, and I strip it back out inside the python script that calls the template (so that I don't have the XML header repeated over and over in my final output XML file). Ugly, yes, but it does work. fm On 10/26/05, Fred Drake [EMAIL PROTECTED] wrote: On 10/26/05, Floyd May [EMAIL PROTECTED] wrote: It appears as though this problem is due to the content-type being set inappropriately (probably text/html). I'm attempting to render XML, but each of the templates only contains a piece of my final output XML file; therefore, I don't have the '?xml ... ?' header in the file. From a perusal of the source for FSPageTemplate, this appears to be the only way to get the Content-Type set to 'text/xml'. Basically, Unfortunately, that's true for the current code. Julien Anguenot and I started working on this problem (along with some other aspects of the XML vs. HTML behavior) based on the Zope 3 implementation for page templates. The work isn't done yet, though the aspect you're interested in is pretty straightforward. That's only for the Zope 3 version of the code, however. For now, your best bet may be to subclass the PageTemplateFile class (or whichever derived class of that that's relevant to you) and override the _cook_check() method to do what you need it to do. If you're using a file-system view, you likely need to arrange for your new class to be used for some new filename extension; I'm not sure how to arrange for that. -Fred -- Fred L. Drake, Jr.fdrake at gmail.com Society attacks early, when the individual is helpless. --B.F. Skinner ___ 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 )
Re: [Zope] Zope/Editor problems
On Oct 26, 2005, at 17:00, Lennart Regebro wrote: On 10/26/05, Håkan Johansson [EMAIL PROTECTED] wrote: My personal guess is that both Epoz and Kupu has hidden prereqs that the documentation does not say, or that I simply missed somehow. You should still get an error message. Do you start the server with bin/runzope or bin/zopectl start? zopectl start ___ 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 )
Re: [Zope] Zope/Editor problems
On 10/26/05, Håkan Johansson [EMAIL PROTECTED] wrote: On Oct 26, 2005, at 17:00, Lennart Regebro wrote: On 10/26/05, Håkan Johansson [EMAIL PROTECTED] wrote: My personal guess is that both Epoz and Kupu has hidden prereqs that the documentation does not say, or that I simply missed somehow. You should still get an error message. Do you start the server with bin/runzope or bin/zopectl start? zopectl start OK, use bin/runzope or zopectl fg, and you will surely get the error message. I'm a bit surprised it doens't end up in the logs as well, but maybe that's expected. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ 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 )
Re: [Zope] Zope/Editor problems
Lennart Regebro wrote: On 10/26/05, Håkan Johansson [EMAIL PROTECTED] wrote: On Oct 26, 2005, at 17:00, Lennart Regebro wrote: On 10/26/05, Håkan Johansson [EMAIL PROTECTED] wrote: My personal guess is that both Epoz and Kupu has hidden prereqs that the documentation does not say, or that I simply missed somehow. You should still get an error message. Do you start the server with bin/runzope or bin/zopectl start? zopectl start OK, use bin/runzope or zopectl fg, and you will surely get the error message. I'm a bit surprised it doens't end up in the logs as well, but maybe that's expected. If you don't run in debug mode the error will be written to the logs (at least in Zope 2.8), presumably because Zope gets to finish starting up and sets up logging. Not logging errors on startup failures (in debug mode) is a problem that causes a lot of consternation. I recall hearing once why it is that way, but don't quite recall. I'm sure I could search the archives and find out. --jcc -- Building Websites with Plone http://plonebook.packtpub.com/ Enfold Systems, LLC http://www.enfoldsystems.com ___ 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 )
[Zope] Zope 2.8.4 released
Hi all, on behalf of Zope Corporation and the Zope community I am pleased to announce the release of Zope 2.8.4. You can download Zope 2.8.2 from http://www.zope.org/Products/Zope/2.8.4/ This version obsoletes Zope 2.8.2 and Zope 2.8.3 which shipped with an older Docutils version as expected. For security reasons you should update to Zope 2.8.4. In addition this release fixes a potential security problem when using Zope with Python 2.4 - although Python 2.4. is neither recommended nor supported. This release does *not mean* that Python 2.4 is from now on supported but there are already installation using Python 2.4 (mostly because modern Linux distributions ship with Python 2.4 and Zope usually uses the system-widePython installation). Some new features of Zope 2.8: - ZODB 3.4 with MVCC (multi version concurrency control) support. MVCC solves nearly every problem with ZODB read-conflict errors which is very important for high-traffic Zope sites. - Extension Classes were rewritten as Python new-style classes making all features of Python new-style classes available in Zope objects. This includes support for cyclic garbage collection. - Integration of Zope 3 technologies through Five (see http://codespeak.net/z3/five/) For more information on what is new in this release, see the CHANGES.txt files for the release: http://www.zope.org/Products/Zope/2.8.3/CHANGES.txt See also: http://www.zope.org/Wikis/DevSite/Projects/Zope2.8/OverView Please bring all the bugs you have found to the Zope bugtracker: http://collector.zope.org/Zope:http://collector.zope.org/Zope For more information on the available Zope releases, guidance for selecting the right distribution and installation instructions, please see: http://www.plope.com/Books/2_7Edition/InstallingZope.stx Please also keep in mind that Zope 2.8.4 requires Python 2.3.5. Zope 2.8.4 is not certified for any Python 2.4.x versions. So using Python 2.4 is neither recommended nor supported and any related questions or problems are likely to be ignored until 2.4 is an officially supported Python version for Zope. -- Andreas Jung(andreas at zopyx dot com) pgp9e2AwjhuWh.pgp Description: PGP signature ___ 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 )
Re: [Zope] How do I Create a empty file in a ZClass object?
Hey, As you'll hear shortly, ZClasses DTML are the old way to do things, and are not highly recommended, at this point. Having said that, I've had success using them. To Add a ZClass into anything folderish, I've used... dtml-call "RESPONSE.redirect('manage_addProduct/WWAudioClip/WWAudioClip_factory')" where WWAudioClip was the name of the Product and its ZClass I place this in a DTML Method that is at the point I wish the ZClass object to be created, a target if you wish. Works fine. This will call the "Add" method in your ZClass. To Add a regular file object somewhere, I've used.. dtml-call "this().manage_addFile(File_object_ID, File_object_contents, File_object_title, content_type='audio/mpeg')" Parameters Zope ID to be set, Contents (string, whatever), and Zope Title, and mime-type (optional) Google "Zope manage_addFile" for more info HTH, Jon Allen Huang wrote: I want to create a empty file in a ZClass object when I first created the ZClass object. How do I do that using DTML?? Yahoo! FareChase - Search multiple travel sites in one click. ___ 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 ) -- Jonathan Cyr [EMAIL PROTECTED] ___ 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 )
[Zope] Zope 2.8 or 3.1?
I'm new to Zope, and I've been playing with 2.8.1, but I really haven't done any real work with it yet. Now I expect to get my new decicated Zope hardware tomorrow, so I have to decide if I should go for 2.8.4 or 3.1.0. Any tips if I should go for the latest and greatest or stick with 2.8? I've also seen comments that running Zope on RHEL/CentOS might not be wise. My test env. is using FC4, but I'm planning to install CenOS 4.2 on the production server. Unwise choice? Regards, Harald ___ 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 )
RE: [Zope] Zope 2.8 or 3.1?
I'm using Zope 2.7.x on RHEL 3.x without trouble ... Though I should be upgrading to CentOS 4.x fairly soon ... what problems have you heard of? As for Zope, if you're not sure, then you probably want 2.8.x ... 3.1 is stable, but for lower level development ... also depends what features you need ... some CMF things aren't avilable in it yet. J.F. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of HaraldFinnåsSent: October 26, 2005 4:43 PMTo: zope@zope.orgSubject: [Zope] Zope 2.8 or 3.1? I'm new to Zope, and I've been playing with 2.8.1, but I really haven't done any real work with it yet. Now I expect to get my new decicated Zope hardware tomorrow, so I have to decide if I should go for 2.8.4 or 3.1.0. Any tips if I should go for the latest and greatest or stick with 2.8? I've also seen comments that running Zope on RHEL/CentOS might not be wise. My test env. is using FC4, but I'm planning to install CenOS 4.2 on the production server. Unwise choice? Regards, Harald ___ 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 )
RE: [Zope] Zope 2.8 or 3.1?
Doyon, Jean-Francois [EMAIL PROTECTED] wrote on 26.10.2005 22:40:09: I'm using Zope 2.7.x on RHEL 3.x without trouble ... Though I should be upgrading to CentOS 4.x fairly soon ... what problems have you heard of? I think the problems were related to OS software versions like Python. And most of us don't like rolling our own packages if we don't have to I'd guess. :) But I've decided to give CentOS 4.2 (or RHEL4U2 in that language :)) a shot anyway. Regards, Harald ___ 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 )
RE: [Zope] Zope 2.8 or 3.1?
Ah ok, well yeah, in my experience it happensthat some requirements exceed the version in the distro. Even if they did *today*, 6 months from now when another Zope comes out requiring a new python version, you'd have to build one yourself anyways. Might as well get used to it now :) It's pretty straight-forward mind you. J.F. From: HaraldFinnås [mailto:[EMAIL PROTECTED] Sent: October 26, 2005 4:55 PMTo: zope@zope.orgCc: Doyon, Jean-FrancoisSubject: RE: [Zope] Zope 2.8 or 3.1? "Doyon, Jean-Francois" [EMAIL PROTECTED] wrote on 26.10.2005 22:40:09: I'm using Zope 2.7.x on RHEL 3.x without trouble ... Though I should be upgrading to CentOS 4.x fairly soon ... what problems have you heard of? I think the problems were related to OS software versions like Python. And most of us don't like rolling our own packages if we don't have to I'd guess. :) But I've decided to give CentOS 4.2 (or RHEL4U2 in "that" language :)) a shot anyway. Regards, Harald ___ 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 )
RE: [Zope] Zope 2.8 or 3.1?
We use lots and lots of Centos 4.x servers not a problem there go for it. Andrew Sawyers Zope Corporation Zope Managed Hosting Software Engineer From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Harald Finns Sent: Wednesday, October 26, 2005 4:43 PM To: zope@zope.org Subject: [Zope] Zope 2.8 or 3.1? I'm new to Zope, and I've been playing with 2.8.1, but I really haven't done any real work with it yet. Now I expect to get my new decicated Zope hardware tomorrow, so I have to decide if I should go for 2.8.4 or 3.1.0. Any tips if I should go for the latest and greatest or stick with 2.8? I've also seen comments that running Zope on RHEL/CentOS might not be wise. My test env. is using FC4, but I'm planning to install CenOS 4.2 on the production server. Unwise choice? Regards, Harald ___ 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 )
RE: [Zope] Zope 2.8 or 3.1?
I meant to send a reply to the list. The gist of my offlist response to Harald was: We use lots and lots of Centos 4.x servers in heavy production with no problems. Go for it. Andrew Sawyers Zope Corporation Zope Managed Hosting Software Engineer From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doyon, Jean-Francois Sent: Wednesday, October 26, 2005 4:40 PM To: 'HaraldFinnås'; zope@zope.org Subject: RE: [Zope] Zope 2.8 or 3.1? I'm using Zope 2.7.x on RHEL 3.x without trouble ... Though I should be upgrading to CentOS 4.x fairly soon ... what problems have you heard of? As for Zope, if you're not sure, then you probably want 2.8.x ... 3.1 is stable, but for lower level development ... also depends what features you need ... some CMF things aren't avilable in it yet. J.F. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of HaraldFinnås Sent: October 26, 2005 4:43 PM To: zope@zope.org Subject: [Zope] Zope 2.8 or 3.1? I'm new to Zope, and I've been playing with 2.8.1, but I really haven't done any real work with it yet. Now I expect to get my new decicated Zope hardware tomorrow, so I have to decide if I should go for 2.8.4 or 3.1.0. Any tips if I should go for the latest and greatest or stick with 2.8? I've also seen comments that running Zope on RHEL/CentOS might not be wise. My test env. is using FC4, but I'm planning to install CenOS 4.2 on the production server. Unwise choice? Regards, Harald ___ 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 )
[Zope] question about stopping acquisition in VHM sites?
Hi, How do I stop acquisition at the root of my website? If I have two websites in zope, and I set the virtual host mapping to www.sitea.com/websites/SiteA www.siteb.com/websites/SiteB I don't want my users to get to SiteB from http://www.sitea.com/SiteB I am using Zope 2.7 Thanks, Gary ___ 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 )
[Zope] question about stopping acquisition in VHM sites?
Hi, How do I stop acquisition at the root of my website? If I have two websites in zope, and I set the virtual host mapping to www.sitea.com/websites/SiteA www.siteb.com/websites/SiteB I don't want my users to get to SiteB from http://www.sitea.com/SiteB I am using Zope 2.7 Thanks, Gary ___ 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 )
[Zope] Permissions and Instances of ZClasses
I'm trying to build a product through the ZMI (like the example in The Zope Book), I have some DTML methods in a ZClass were I want to be able to do a SecurityCheckPermission() on a permission that I have defined in the containing product. When I view the instance of the DTML, it doesn't see the permission. I'm able to at least see the 'View' permission... When I look around in the Permissions and Define Permissions of the various objects (both the ZClass, and the DTML methods), I don't see my permission in the lists, except for under 'Class Permissions' in the Permissions tab for the ZClass (were I have highlighted it, which I assume is correct?) The call to SecurityCheckPermission() looks like this... dtml-if expr=_.SecurityCheckPermission('Manage Diary',this()) I'm thinking maybe I'm calling SecurityCheckPermission in the wrong context? Making a product certainly can be confusing at times. :) Thanks! -- David Case [EMAIL PROTECTED] www.builddiary.net ___ 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 )
[Zope] Re: Zope 2.8 or 3.1?
On Wed, 26 Oct 2005 13:43:21 -0700, HaraldFinnås [EMAIL PROTECTED] wrote: I'm new to Zope, and I've been playing with 2.8.1, but I really haven't done any real work with it yet. Now I expect to get my new decicated Zope hardware tomorrow, so I have to decide if I should go for 2.8.4 or 3.1.0. Any tips if I should go for the latest and greatest or stick with 2.8? These are two totally separate code bases, and have nothing at all to do with each other. Zope 3 is a ground-up rewrite of Zope, and shares no code (or application compatibility) with Zope 2. -- _ Alexander Limi · Chief Architect · Plone Solutions · Norway Consulting · Training · Development · http://www.plonesolutions.com _ Plone Co-Founder · http://plone.org · Connecting Content Plone Foundation · http://plone.org/foundation · Protecting Plone ___ 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 )
[Zope-Annce] Zope 2.8.4 released
Hi all, on behalf of Zope Corporation and the Zope community I am pleased to announce the release of Zope 2.8.4. You can download Zope 2.8.2 from http://www.zope.org/Products/Zope/2.8.4/ This version obsoletes Zope 2.8.2 and Zope 2.8.3 which shipped with an older Docutils version as expected. For security reasons you should update to Zope 2.8.4. In addition this release fixes a potential security problem when using Zope with Python 2.4 - although Python 2.4. is neither recommended nor supported. This release does *not mean* that Python 2.4 is from now on supported but there are already installation using Python 2.4 (mostly because modern Linux distributions ship with Python 2.4 and Zope usually uses the system-widePython installation). Some new features of Zope 2.8: - ZODB 3.4 with MVCC (multi version concurrency control) support. MVCC solves nearly every problem with ZODB read-conflict errors which is very important for high-traffic Zope sites. - Extension Classes were rewritten as Python new-style classes making all features of Python new-style classes available in Zope objects. This includes support for cyclic garbage collection. - Integration of Zope 3 technologies through Five (see http://codespeak.net/z3/five/) For more information on what is new in this release, see the CHANGES.txt files for the release: http://www.zope.org/Products/Zope/2.8.3/CHANGES.txt See also: http://www.zope.org/Wikis/DevSite/Projects/Zope2.8/OverView Please bring all the bugs you have found to the Zope bugtracker: http://collector.zope.org/Zope:http://collector.zope.org/Zope For more information on the available Zope releases, guidance for selecting the right distribution and installation instructions, please see: http://www.plope.com/Books/2_7Edition/InstallingZope.stx Please also keep in mind that Zope 2.8.4 requires Python 2.3.5. Zope 2.8.4 is not certified for any Python 2.4.x versions. So using Python 2.4 is neither recommended nor supported and any related questions or problems are likely to be ignored until 2.4 is an officially supported Python version for Zope. -- Andreas Jung(andreas at zopyx dot com) pgpzC7Q3a3EVJ.pgp Description: PGP signature ___ Zope-Announce maillist - Zope-Announce@zope.org http://mail.zope.org/mailman/listinfo/zope-announce Zope-Announce for Announcements only - no discussions (Related lists - Users: http://mail.zope.org/mailman/listinfo/zope Developers: http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope-Checkins] SVN: Zope/trunk/ Added a 'product-config' section type to zope.conf, allowing arbitrary key-value mappings.
Log message for revision 39635: Added a 'product-config' section type to zope.conf, allowing arbitrary key-value mappings. Products can look for such confgiurations to set product-specific options (see the example 'product-config' section in skel/etc/zope.conf.in for sample usage). Changed: U Zope/trunk/doc/CHANGES.txt U Zope/trunk/lib/python/Zope2/Startup/datatypes.py U Zope/trunk/lib/python/Zope2/Startup/zopeschema.xml U Zope/trunk/skel/etc/zope.conf.in -=- Modified: Zope/trunk/doc/CHANGES.txt === --- Zope/trunk/doc/CHANGES.txt 2005-10-26 14:54:24 UTC (rev 39634) +++ Zope/trunk/doc/CHANGES.txt 2005-10-26 16:09:59 UTC (rev 39635) @@ -26,6 +26,12 @@ Features added + - Added a 'product-config' section type to zope.conf, allowing +arbitrary key-value mappings. Products can look for such +confgiurations to set product-specific options (see the +example 'product-config' section in skel/etc/zope.conf.in +for sample usage). + - Collector #1490: Added a new zope.conf option to control the character set used to encode unicode data that reaches ZPublisher without any specified encoding. Modified: Zope/trunk/lib/python/Zope2/Startup/datatypes.py === --- Zope/trunk/lib/python/Zope2/Startup/datatypes.py2005-10-26 14:54:24 UTC (rev 39634) +++ Zope/trunk/lib/python/Zope2/Startup/datatypes.py2005-10-26 16:09:59 UTC (rev 39635) @@ -150,6 +150,12 @@ from DBTab.DBTab import DBTab section.dbtab = DBTab(mount_factories, mount_points) +pconfigs = {} +for pconfig in section.product_config: +pconfigs[pconfig.getSectionName()] = pconfig.mapping + +section.product_config = pconfigs + return section class ZopeDatabase(ZODBDatabase): @@ -221,3 +227,6 @@ Converters.default_encoding = value HTTPRequest.default_encoding = value HTTPResponse.default_encoding = value + +class ProductConfig(dict): +pass Modified: Zope/trunk/lib/python/Zope2/Startup/zopeschema.xml === --- Zope/trunk/lib/python/Zope2/Startup/zopeschema.xml 2005-10-26 14:54:24 UTC (rev 39634) +++ Zope/trunk/lib/python/Zope2/Startup/zopeschema.xml 2005-10-26 16:09:59 UTC (rev 39635) @@ -821,5 +821,23 @@ metadefaultiso-8859-15/metadefault /key + sectiontype name=product-config +description +Product-specific configuration, expressed as arbitrary name-value pairs. +/description +key name=+ + attribute=mapping + required=no + / + /sectiontype + + multisection type=product-config name=+ +attribute=product_config + description +Product-specific configuration, expressed as arbitrary name-value pairs. + /description + /multisection + + /schema Modified: Zope/trunk/skel/etc/zope.conf.in === --- Zope/trunk/skel/etc/zope.conf.in2005-10-26 14:54:24 UTC (rev 39634) +++ Zope/trunk/skel/etc/zope.conf.in2005-10-26 16:09:59 UTC (rev 39635) @@ -969,3 +969,22 @@ # #client zeo1 # /zeoclient # /zodb_db + +# Product configuration (product-config) section(s) +# +# Description: +#Add-on products may need to allow the user to specify policy / +#configuration. Such policies may be expressed as a set of +#name-value pairs, grouped into a named section (there may +#be many such sections, typically one per product). +#These sections will be captured in an attribute, 'product_config' +#of the top-level config object, under the key corresponding to +#the section name. E.g., the sample section below would be +#parsed into a dict, {'bar': 'baz'}, available as +#config.product_config['foo'] +# +# Example: +# +# product-config foo +#bar baz +# /product-config ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/ Added protection against the (small) risk that someone could mitate an
Log message for revision 39645: Added protection against the (small) risk that someone could mitate an object through an augmented assignment (aka inplace) operator. Changed: U Zope/branches/Zope-2_8-branch/lib/python/AccessControl/ZopeGuards.py U Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/actual_python.py U Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testZopeGuards.py U Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/before_and_after.py U Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/restricted_module.py U Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/security_in_syntax.py -=- Modified: Zope/branches/Zope-2_8-branch/lib/python/AccessControl/ZopeGuards.py === --- Zope/branches/Zope-2_8-branch/lib/python/AccessControl/ZopeGuards.py 2005-10-26 17:12:32 UTC (rev 39644) +++ Zope/branches/Zope-2_8-branch/lib/python/AccessControl/ZopeGuards.py 2005-10-26 17:12:35 UTC (rev 39645) @@ -375,6 +375,112 @@ ob._guarded_writes = 1 return ob +try: +valid_inplace_types = list, set +except NameError: +# Python 2.3 +valid_inplace_types = list + +inplace_slots = { +'+=': '__iadd__', +'-=': '__isub__', +'*=': '__imul__', +'/=': (1/2 == 0) and '__idiv__' or '__itruediv__', +'//=': '__ifloordiv__', +'%=': '__imod__', +'**=': '__ipow__', +'=': '__ilshift__', +'=': '__irshift__', +'=': '__iand__', +'^=': '__ixor__', +'|=': '__ior_', +} + + +def __iadd__(x, y): +x += y +return x + +def __isub__(x, y): +x -= y +return x + +def __imul__(x, y): +x *= y +return x + +def __idiv__(x, y): +x /= y +return x + +def __ifloordiv__(x, y): +x //= y +return x + +def __imod__(x, y): +x %= y +return x + +def __ipow__(x, y): +x **= y +return x + +def __ilshift__(x, y): +x = y +return x + +def __irshift__(x, y): +x = y +return x + +def __iand__(x, y): +x = y +return x + +def __ixor__(x, y): +x ^= y +return x + +def __ior__(x, y): +x |= y +return x + + +inplace_ops = { +'+=': __iadd__, +'-=': __isub__, +'*=': __imul__, +'/=': __idiv__, +'//=': __ifloordiv__, +'%=': __imod__, +'**=': __ipow__, +'=': __ilshift__, +'=': __irshift__, +'=': __iand__, +'^=': __ixor__, +'|=': __ior__, +} + + +def protected_inplacevar(op, var, expr): +Do an inplace operation + +If the var has an inplace slot, then disallow the operation +unless the var is a list. + +if (hasattr(var, inplace_slots[op]) +and not isinstance(var, valid_inplace_types) +): +try: +cls = var.__class__ +except AttributeError: +cls = type(var) +raise TypeError( +Augmented assignment to %s objects is not allowed + in untrusted code % cls.__name__ +) +return inplace_ops[op](var, expr) + # AccessControl clients generally need to set up a safe globals dict for # use by restricted code. The get_safe_globals() function returns such # a dict, containing '__builtins__' mapped to our safe bulitins, and @@ -394,6 +500,7 @@ '_getiter_':guarded_iter, '_print_': RestrictedPython.PrintCollector, '_write_': full_write_guard, + '_inplacevar_': protected_inplacevar, # The correct implementation of _getattr_, aka # guarded_getattr, isn't known until # AccessControl.Implementation figures that out, then Modified: Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/actual_python.py === --- Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/actual_python.py 2005-10-26 17:12:32 UTC (rev 39644) +++ Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/actual_python.py 2005-10-26 17:12:35 UTC (rev 39645) @@ -157,3 +157,9 @@ def f10(): assert iter(enumerate(iter(iter(range(9).next() == (0, 0) f10() + +def f11(): +x = 1 +x += 1 +f11() + Modified: Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testZopeGuards.py === --- Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testZopeGuards.py 2005-10-26 17:12:32 UTC (rev 39644) +++ Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testZopeGuards.py 2005-10-26 17:12:35 UTC (rev 39645) @@ -20,6 +20,7 @@ import os, sys import unittest +from zope.testing import doctest import ZODB import AccessControl.SecurityManagement from AccessControl.SimpleObjectPolicies import ContainerAssertions @@ -671,8 +672,90 @@ if callable(v) and v is not
[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/before_and_after24.py Added tests for handling generator expressions.
Log message for revision 39646: Added tests for handling generator expressions. Changed: A Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/before_and_after24.py -=- Copied: Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/before_and_after24.py (from rev 39505, Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/before_and_after.py) === --- Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/before_and_after.py 2005-10-18 17:17:55 UTC (rev 39505) +++ Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/before_and_after24.py 2005-10-26 17:12:37 UTC (rev 39646) @@ -0,0 +1,41 @@ +## +# +# Copyright (c) 2003 Zope Corporation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +## +Restricted Python transformation examples + +This module contains pairs of functions. Each pair has a before and an +after function. The after function shows the source code equivalent +of the before function after it has been modified by the restricted +compiler. + +These examples are actually used in the testRestrictions.py +checkBeforeAndAfter() unit tests, which verifies that the restricted compiler +actually produces the same output as would be output by the normal compiler +for the after function. + +$Id$ + + +def simple_generator_expression_before(): +x = (y**2 for y in whatever if y 3) + +def simple_generator_expression_after(): +x = (y**2 for y in _getiter_(whatever) if y 3) + +def nested_generator_expression_before(): +x = (x**2 + y**2 for x in whatever1 if x = 0 + for y in whatever2 if y = x) + +def nested_generator_expression_after(): +x = (x**2 + y**2 for x in _getiter_(whatever1) if x = 0 + for y in _getiter_(whatever2) if y = x) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/testRestrictions.py Fixed a bug in getting source that prevented tests from being used if
Log message for revision 39647: Fixed a bug in getting source that prevented tests from being used if there were pyc files around. Sigh. Added tests for restrictions on augmented assignment and for handling generator expressions. Changed: U Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/testRestrictions.py -=- Modified: Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/testRestrictions.py === --- Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/testRestrictions.py 2005-10-26 17:12:37 UTC (rev 39646) +++ Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/tests/testRestrictions.py 2005-10-26 17:12:39 UTC (rev 39647) @@ -12,7 +12,7 @@ from RestrictedPython import compile_restricted, PrintCollector from RestrictedPython.Eval import RestrictionCapableEval -from RestrictedPython.tests import before_and_after, restricted_module, verify +from RestrictedPython.tests import restricted_module, verify from RestrictedPython.RCompile import RModule, RFunction try: @@ -51,8 +51,13 @@ return fn, msg def get_source(func): -Less silly interface to find_source # Sheesh -return find_source(func.func_globals['__file__'], func.func_code)[1] +Less silly interface to find_source +file = func.func_globals['__file__'] +if file.endswith('.pyc'): +file = file[:-1] +source = find_source(file, func.func_code)[1] +assert source.strip(), Source should not be empty! +return source def create_rmodule(): global rmodule @@ -175,6 +180,14 @@ apply_wrapper_called.append('yes') return func(*args, **kws) +inplacevar_wrapper_called = {} +def inplacevar_wrapper(op, x, y): +inplacevar_wrapper_called[op] = x, y +# This is really lame. But it's just a test. :) +globs = {'x': x, 'y': y} +exec 'x'+op+'y' in globs +return globs['x'] + class RestrictionTests(unittest.TestCase): def execFunc(self, name, *args, **kw): func = rmodule[name] @@ -191,6 +204,7 @@ # work for everything. '_getiter_': list, '_apply_': apply_wrapper, + '_inplacevar_': inplacevar_wrapper, }) return func(*args, **kw) @@ -243,6 +257,11 @@ self.assertEqual(apply_wrapper_called, [yes]) self.assertEqual(res, 321) +def checkInplace(self): +inplacevar_wrapper_called.clear() +res = self.execFunc('try_inplace') +self.assertEqual(inplacevar_wrapper_called['+='], (1, 3)) + def checkDenied(self): for k in rmodule.keys(): if k[:6] == 'denied': @@ -314,7 +333,7 @@ def checkBeforeAndAfter(self): from RestrictedPython.RCompile import RModule - +from RestrictedPython.tests import before_and_after from compiler import parse defre = re.compile(r'def ([_A-Za-z0-9]+)_(after|before)\(') @@ -339,6 +358,34 @@ rm.compile() verify.verify(rm.getCode()) +if sys.version_info[:2] = (2, 4): +def checkBeforeAndAfter24(self): +from RestrictedPython.RCompile import RModule +from RestrictedPython.tests import before_and_after24 +from compiler import parse + +defre = re.compile(r'def ([_A-Za-z0-9]+)_(after|before)\(') + +beforel = [name for name in before_and_after24.__dict__ + if name.endswith(_before)] + +for name in beforel: +before = getattr(before_and_after24, name) +before_src = get_source(before) +before_src = re.sub(defre, r'def \1(', before_src) +rm = RModule(before_src, '') +tree_before = rm._get_tree() + +after = getattr(before_and_after24, name[:-6]+'after') +after_src = get_source(after) +after_src = re.sub(defre, r'def \1(', after_src) +tree_after = parse(after_src) + +self.assertEqual(str(tree_before), str(tree_after)) + +rm.compile() +verify.verify(rm.getCode()) + def _compile_file(self, name): path = os.path.join(_HERE, name) f = open(path, r) @@ -355,7 +402,7 @@ def getiter(seq): calls.append(seq) return list(seq) -globals = {_getiter_: getiter} +globals = {_getiter_: getiter, '_inplacevar_': inplacevar_wrapper} exec co in globals, {} # The comparison here depends on the exact code that is # contained in unpack.py. ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ Zope 2.8.4
Log message for revision 39649: Zope 2.8.4 Changed: U Zope/branches/Zope-2_8-branch/doc/CHANGES.txt U Zope/branches/Zope-2_8-branch/inst/WinBuilders/mk/zope.mk U Zope/branches/Zope-2_8-branch/inst/versions.py -=- Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt === --- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-10-26 17:17:25 UTC (rev 39648) +++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-10-26 17:21:46 UTC (rev 39649) @@ -24,7 +24,7 @@ - Zope 2.8.4 + Zope 2.8.4 (2005/10/26) Bugs Fixed Modified: Zope/branches/Zope-2_8-branch/inst/WinBuilders/mk/zope.mk === --- Zope/branches/Zope-2_8-branch/inst/WinBuilders/mk/zope.mk 2005-10-26 17:17:25 UTC (rev 39648) +++ Zope/branches/Zope-2_8-branch/inst/WinBuilders/mk/zope.mk 2005-10-26 17:21:46 UTC (rev 39649) @@ -3,7 +3,7 @@ REQUIRED_FILES=$(PYTHON_REQUIRED_FILES)\ $(ZOPE_REQUIRED_FILES) -ZOPEVERSION=2.8.3-final +ZOPEVERSION=2.8.4-final ZOPEDIRNAME=Zope-$(ZOPEVERSION) MAKEZOPE=$(MAKEFILEDIR)/bin/makezope.bat $(WIN_BUILD_DIR) Modified: Zope/branches/Zope-2_8-branch/inst/versions.py === --- Zope/branches/Zope-2_8-branch/inst/versions.py 2005-10-26 17:17:25 UTC (rev 39648) +++ Zope/branches/Zope-2_8-branch/inst/versions.py 2005-10-26 17:21:46 UTC (rev 39649) @@ -1,5 +1,5 @@ ZOPE_MAJOR_VERSION = '2.8' -ZOPE_MINOR_VERSION = '3' +ZOPE_MINOR_VERSION = '4' ZOPE_BRANCH_NAME= '$Name$'[6:] or 'no-branch' # always start prerelease branches with '0' to avoid upgrade ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/tags/Zope-2-8-4/ Zope 2.8.4
Log message for revision 39650: Zope 2.8.4 Changed: A Zope/tags/Zope-2-8-4/ -=- Copied: Zope/tags/Zope-2-8-4 (from rev 39649, Zope/branches/Zope-2_8-branch) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/ Allow custom section types to play in product-config.
Log message for revision 39652: Allow custom section types to play in product-config. Changed: U Zope/trunk/doc/CHANGES.txt U Zope/trunk/lib/python/Zope2/Startup/datatypes.py U Zope/trunk/lib/python/Zope2/Startup/zopeschema.xml U Zope/trunk/skel/etc/zope.conf.in -=- Modified: Zope/trunk/doc/CHANGES.txt === --- Zope/trunk/doc/CHANGES.txt 2005-10-26 18:36:17 UTC (rev 39651) +++ Zope/trunk/doc/CHANGES.txt 2005-10-26 19:10:40 UTC (rev 39652) @@ -28,9 +28,10 @@ - Added a 'product-config' section type to zope.conf, allowing arbitrary key-value mappings. Products can look for such -confgiurations to set product-specific options (see the -example 'product-config' section in skel/etc/zope.conf.in -for sample usage). +confgiurations to set product-specific options. Products mwy +also register their own section types, extending the +'zope.product.base' type. (see the example 'product-config' +section in skel/etc/zope.conf.in for sample usage). - Collector #1490: Added a new zope.conf option to control the character set used to encode unicode data that reaches Modified: Zope/trunk/lib/python/Zope2/Startup/datatypes.py === --- Zope/trunk/lib/python/Zope2/Startup/datatypes.py2005-10-26 18:36:17 UTC (rev 39651) +++ Zope/trunk/lib/python/Zope2/Startup/datatypes.py2005-10-26 19:10:40 UTC (rev 39652) @@ -113,6 +113,7 @@ def root_config(section): from ZConfig import ConfigurationError +from ZConfig.matcher import SectionValue here = os.path.dirname(os.path.abspath(__file__)) swhome = os.path.dirname(os.path.dirname(here)) section.softwarehome = swhome @@ -152,7 +153,15 @@ pconfigs = {} for pconfig in section.product_config: -pconfigs[pconfig.getSectionName()] = pconfig.mapping +section_name = pconfig.getSectionName() +if isinstance(pconfig, SectionValue): +section_type = pconfig.getSectionType() +if section_type == 'product-config': +pconfigs[section_name] = pconfig.mapping +else: +pconfigs[section_name] = pconfig +else: +pconfigs[section_name] = pconfig section.product_config = pconfigs @@ -227,6 +236,3 @@ Converters.default_encoding = value HTTPRequest.default_encoding = value HTTPResponse.default_encoding = value - -class ProductConfig(dict): -pass Modified: Zope/trunk/lib/python/Zope2/Startup/zopeschema.xml === --- Zope/trunk/lib/python/Zope2/Startup/zopeschema.xml 2005-10-26 18:36:17 UTC (rev 39651) +++ Zope/trunk/lib/python/Zope2/Startup/zopeschema.xml 2005-10-26 19:10:40 UTC (rev 39652) @@ -821,8 +821,19 @@ metadefaultiso-8859-15/metadefault /key - sectiontype name=product-config + abstracttype name=zope.product.base description + Base type for product-specific configuration sections. + + Specific products should implement configuration sections by + defining section types that implement this abstract type and + using their own schema component to define meaningful settings. + +/description + /abstracttype + + sectiontype name=product-config implements=zope.product.base +description Product-specific configuration, expressed as arbitrary name-value pairs. /description @@ -832,12 +843,17 @@ / /sectiontype - multisection type=product-config name=+ + multisection type=zope.product.base name=+ attribute=product_config description -Product-specific configuration, expressed as arbitrary name-value pairs. +Product-specific configuration stanzas. + +Products may use the lt;product-configgt; section type, or may supply +a component.xml which defines section types with their own schemas. + +All sections for this multisection will be collected into the +'product_config' attribute of the configuration object. /description /multisection - /schema Modified: Zope/trunk/skel/etc/zope.conf.in === --- Zope/trunk/skel/etc/zope.conf.in2005-10-26 18:36:17 UTC (rev 39651) +++ Zope/trunk/skel/etc/zope.conf.in2005-10-26 19:10:40 UTC (rev 39652) @@ -983,8 +983,37 @@ #parsed into a dict, {'bar': 'baz'}, available as #config.product_config['foo'] # +#Products may also register their own section types, extending +# +# # Example: # -# product-config foo -#bar baz -# /product-config +# 1. Simple bag of strings section: +# +#product-config foo +# bar baz +#/product-config +# +# 2. Custom section type +# +#Products/Foo/component.xml: +# +#component +# description +# Some product-specific hackery.
[Zope-Coders] Zope tests: 6 OK, 2 Unknown
Summary of messages to the zope-tests list. Period Tue Oct 25 11:01:01 2005 UTC to Wed Oct 26 11:01:01 2005 UTC. There were 8 messages: 8 from Zope Unit Tests. Unknown --- Subject: UNKNOWN : Zope-trunk Python-2.3.5 : Linux From: Zope Unit Tests Date: Tue Oct 25 22:38:01 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003413.html Subject: UNKNOWN : Zope-trunk Python-2.4.2 : Linux From: Zope Unit Tests Date: Tue Oct 25 22:39:31 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003414.html Tests passed OK --- Subject: OK : Zope-2_6-branch Python-2.1.3 : Linux From: Zope Unit Tests Date: Tue Oct 25 22:29:00 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003407.html Subject: OK : Zope-2_6-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Tue Oct 25 22:30:31 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003408.html Subject: OK : Zope-2_7-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Tue Oct 25 22:32:01 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003409.html Subject: OK : Zope-2_7-branch Python-2.4.2 : Linux From: Zope Unit Tests Date: Tue Oct 25 22:33:31 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003410.html Subject: OK : Zope-2_8-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Tue Oct 25 22:35:01 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003411.html Subject: OK : Zope-2_8-branch Python-2.4.2 : Linux From: Zope Unit Tests Date: Tue Oct 25 22:36:31 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-October/003412.html ___ Zope-Coders mailing list Zope-Coders@zope.org http://mail.zope.org/mailman/listinfo/zope-coders
[Zope-dev] Re: New testrunner on the Zope 2 trunk.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: I just checked in a new test runner on the trunk. It is mostly backward compatible with the old test runner. You can get help on the test runner by running it with -h. There is more extensive documentation in lib/python/zope/testing/testrunner.txt. Note that the new test runner complains if test_suite functions don't return test suites. There is a zope.i18n test suite that it currently complains about. Unfortunately, I can't just fix this because it is an svn:external and it will be too painful to create a tag with the necessary fix in the short term. I expect we will be integrating a newer version of Zope 3 later in the week and we'll take care of this then. I'm seeing test failures out of the self-tests for the new testrunner: Failure in test /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/testrunner-coverage.txt Failed doctest test for testrunner-coverage.txt File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/testrunner-coverage.txt, line 0 - -- File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/testrunner-coverage.txt, line 20, in testrunner-coverage.txt Failed example: testrunner.run(defaults) Expected: Running unit tests: ... lines cov% module (path) ... testrunner.py) ... Got: Running unit tests: Ran 192 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer1 tests: Set up samplelayers.Layer1 in N.NNN seconds. Ran 9 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer11 tests: Set up samplelayers.Layer11 in N.NNN seconds. Ran 34 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer111 tests: Set up samplelayers.Layerx in N.NNN seconds. Set up samplelayers.Layer111 in N.NNN seconds. Ran 34 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer112 tests: Tear down samplelayers.Layer111 in N.NNN seconds. Set up samplelayers.Layer112 in N.NNN seconds. Ran 34 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer12 tests: Tear down samplelayers.Layer112 in N.NNN seconds. Tear down samplelayers.Layerx in N.NNN seconds. Tear down samplelayers.Layer11 in N.NNN seconds. Set up samplelayers.Layer12 in N.NNN seconds. Ran 34 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer121 tests: Set up samplelayers.Layer121 in N.NNN seconds. Ran 34 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer122 tests: Tear down samplelayers.Layer121 in N.NNN seconds. Set up samplelayers.Layer122 in N.NNN seconds. Ran 34 tests with 0 failures and 0 errors in N.NNN seconds. Tearing down left over layers: Tear down samplelayers.Layer122 in N.NNN seconds. Tear down samplelayers.Layer12 in N.NNN seconds. Tear down samplelayers.Layer1 in N.NNN seconds. Total: 405 tests, 0 failures, 0 errors False - -- File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/testrunner-coverage.txt, line 30, in testrunner-coverage.txt Failed example: os.path.exists('coverage_dir') Expected: True Got: False - -- File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/testrunner-coverage.txt, line 32, in testrunner-coverage.txt Failed example: os.listdir('coverage_dir') Exception raised: Traceback (most recent call last): File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/doctest.py, line 1256, in __run compileflags, 1) in test.globs File doctest testrunner-coverage.txt[7], line 1, in ? OSError: [Errno 2] No such file or directory: 'coverage_dir' - -- File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/testrunner-coverage.txt, line 38, in testrunner-coverage.txt Failed example: shutil.rmtree('coverage_dir') Exception raised: Traceback (most recent call last): File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/doctest.py, line 1256, in __run compileflags, 1) in test.globs File doctest testrunner-coverage.txt[9], line 1, in ? File /home/tseaver/projects/Zope-CVS/lib/python2.3/shutil.py, line 142, in rmtree raise exc[0], (exc[1][0], exc[1][1] + ' removing '+arg) OSError: [Errno 2] No such file or directory removing coverage_dir .. .. .. Ran 7352 tests with 1
[Zope-dev] Re: New testrunner on the Zope 2 trunk.
Weird. I can't reproduce this. Is anyone else seeing this? Jim Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: I just checked in a new test runner on the trunk. It is mostly backward compatible with the old test runner. You can get help on the test runner by running it with -h. There is more extensive documentation in lib/python/zope/testing/testrunner.txt. Note that the new test runner complains if test_suite functions don't return test suites. There is a zope.i18n test suite that it currently complains about. Unfortunately, I can't just fix this because it is an svn:external and it will be too painful to create a tag with the necessary fix in the short term. I expect we will be integrating a newer version of Zope 3 later in the week and we'll take care of this then. I'm seeing test failures out of the self-tests for the new testrunner: Failure in test /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/testrunner-coverage.txt Failed doctest test for testrunner-coverage.txt File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/testrunner-coverage.txt, line 0 - -- File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/testrunner-coverage.txt, line 20, in testrunner-coverage.txt Failed example: testrunner.run(defaults) Expected: Running unit tests: ... lines cov% module (path) ... testrunner.py) ... Got: Running unit tests: Ran 192 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer1 tests: Set up samplelayers.Layer1 in N.NNN seconds. Ran 9 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer11 tests: Set up samplelayers.Layer11 in N.NNN seconds. Ran 34 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer111 tests: Set up samplelayers.Layerx in N.NNN seconds. Set up samplelayers.Layer111 in N.NNN seconds. Ran 34 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer112 tests: Tear down samplelayers.Layer111 in N.NNN seconds. Set up samplelayers.Layer112 in N.NNN seconds. Ran 34 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer12 tests: Tear down samplelayers.Layer112 in N.NNN seconds. Tear down samplelayers.Layerx in N.NNN seconds. Tear down samplelayers.Layer11 in N.NNN seconds. Set up samplelayers.Layer12 in N.NNN seconds. Ran 34 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer121 tests: Set up samplelayers.Layer121 in N.NNN seconds. Ran 34 tests with 0 failures and 0 errors in N.NNN seconds. Running samplelayers.Layer122 tests: Tear down samplelayers.Layer121 in N.NNN seconds. Set up samplelayers.Layer122 in N.NNN seconds. Ran 34 tests with 0 failures and 0 errors in N.NNN seconds. Tearing down left over layers: Tear down samplelayers.Layer122 in N.NNN seconds. Tear down samplelayers.Layer12 in N.NNN seconds. Tear down samplelayers.Layer1 in N.NNN seconds. Total: 405 tests, 0 failures, 0 errors False - -- File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/testrunner-coverage.txt, line 30, in testrunner-coverage.txt Failed example: os.path.exists('coverage_dir') Expected: True Got: False - -- File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/testrunner-coverage.txt, line 32, in testrunner-coverage.txt Failed example: os.listdir('coverage_dir') Exception raised: Traceback (most recent call last): File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/doctest.py, line 1256, in __run compileflags, 1) in test.globs File doctest testrunner-coverage.txt[7], line 1, in ? OSError: [Errno 2] No such file or directory: 'coverage_dir' - -- File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/testrunner-coverage.txt, line 38, in testrunner-coverage.txt Failed example: shutil.rmtree('coverage_dir') Exception raised: Traceback (most recent call last): File /home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/lib/python/zope/testing/doctest.py, line 1256, in __run compileflags, 1) in test.globs File doctest testrunner-coverage.txt[9], line 1, in ? File /home/tseaver/projects/Zope-CVS/lib/python2.3/shutil.py, line 142, in rmtree raise exc[0], (exc[1][0], exc[1][1] + ' removing '+arg) OSError: [Errno 2] No such file or directory removing coverage_dir ..
[Zope-dev] New(ish) Windows test failures on Zope trunk
I see two test failures today on Zope(2) trunk, WinXP, Python version doesn't matter (same thing under 2.3.5 2.4.2). Failure in test testRegisterTranslations (zope.app.i18n.tests.testi18ndirectives.DirectivesTest) Traceback (most recent call last): File C:\Code\Zope\lib/python\zope\app\i18n\tests\testi18ndirectives.py, line 55, in testRegisterTranslations eq(util._catalogs, {'en': [unicode(path)]}) File C:\python23\lib\unittest.py, line 302, in failUnlessEqual raise self.failureException, \ AssertionError: {u'en': [u'C:\\Code\\Zope\\lib\\python\\zope\\i18n\\tests\\locale\\en\\LC_MESSAGES\\zope-i18n.mo']} != {'en': [u'C:\\Code\\Zope\\lib/python\\zope\\i18n\\tests\\locale\\en\\LC_MESSAGES\\zope-i18n.mo']} One dict has a Unicode key there while the other dict doesn't, and the python part of the value is preceded by a backslash in one but a forward slash in the other. Then: Failure in test checkDuplicate (zope.configuration.config.ConfigurationContext) Failed doctest test for zope.configuration.config.ConfigurationContext.checkDuplicate File C:\Code\Zope\lib/python\zope\configuration\config.py, line 259, in checkDuplicate File C:\Code\Zope\lib/python\zope\configuration\config.py, line 281, in zope.configuration.config.ConfigurationContext .checkDuplicate Failed example: try: c.checkDuplicate(d + os.path.normpath('/bar.zcml')) except ConfigurationError, e: str(e).endswith(bar.zcml' included more than once) Expected: True Got nothing _Looks_ like the test expected ConfigurationError to be raised, but that ConfigurationError was not raised. Oddly enough, I believe this is related to the first test failure. Dumping some prints in checkDuplicate() shows that, when the test fails, `path` is 'C:\\Code\\Zope\\lib\\python\\zope\\configuration\\bar.zcml' and self._seen_files is a set with two elements: 'C:\\Code\\Zope\\lib/python\\zope\\configuration\\bar.zcml' '\\foo.zcml' As in the first test too, the character preceding the python part differs. The path passed is indeed not in the set of _seen_files, so ConfigurationError is indeed not raised. No idea where this slash-vs-backslash confusion ultimately comes from, though. Who recently checked code in hard-coding / as a path separator? ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Experiencing TypeError: The object is not a PySECURITY_ATTRIBUTES object
[Mark Hammond] FYI, there is a new pywin32 build out now that should solve this problem without requiring any imports to be reordered. Yay! It would be great if whoever turns the crank for the next Zope/Windows builds (which may even turn out to be me! :) uses build 205. Andreas Jung made a surprise release of Zope 2.8.4 today, but only the tarball, not a Windows installer. If you want to make the latter, more than fine by me, else I'll try to make one tomorrow (with your build 205, of course -- will require some retroactive patching of the 2.8.4 tag no matter who does it). Sadly, I believe it is not trivial to install a new pywin32 build into a Zope binary. You could patch it up though by opening the pywin32 release executable in WinZip (or similar), then replacing 'pywintypes.py' and extracting a new _win32sysloader.pyd module. Ya, like Windows users are gonna do _that_ wink. Finally, I believe another way to solve this problem would be to remove pywintypes23.dll from the system32 directory (the the underlying problem is that 2 copies of this DLL are being loaded into memory). However, doing this may prevent other things (such as your existing Python installation) from working correctly, so do this with caution. Zope does not install anything into system32, so presumably something else on your system is also using Python. All recent PySECURITY_ATTRIBUTES complaints I know about have come from people using both Zope and Plone. I don't know anything about Plone installation, but it's natural to suspect that Plone is the source of the other pywin32 installation, and possibly of compounding sys.path convolutions too. So, a natural question based on this ignorance: is it enough for just Zope to install build 205, if Plone also installs its own (older) pywin32 and mangles sys.path so that its pywin32 is also visible? I suspect (but don't know) that's what's happening. It would be a lot better if a Plone user tested the proposed solution before we release another Windows Zope that may still turn out not to solve Plone's problems here. ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Experiencing TypeError: The object is not a PySECURITY_ATTRIBUTES object
Hi Guys, Thanks for your responses. I'll investigate the version of Plone that I had downloaded (2.1.1) to see whether or not there are any calls to the pywintypes32 library within the Plone products that could be causing this problem. I had suspected it may be a Plone issue because I didn't see the problem when I just installed Zope, and started it up. Only after adding the Plone products did I start to see the problem. However, I wasn't sure what might be causing it because I'm not really a Python guy. To be honest, I've never used it before. So I'll check into this and get back to you. I'd be happy to test the proposed solution BTW, if you send me a tarball, and report the results to the list. Thanks! Cheers, Chris On 10/26/05 3:00 PM, Tim Peters [EMAIL PROTECTED] wrote: [Mark Hammond] FYI, there is a new pywin32 build out now that should solve this problem without requiring any imports to be reordered. Yay! It would be great if whoever turns the crank for the next Zope/Windows builds (which may even turn out to be me! :) uses build 205. Andreas Jung made a surprise release of Zope 2.8.4 today, but only the tarball, not a Windows installer. If you want to make the latter, more than fine by me, else I'll try to make one tomorrow (with your build 205, of course -- will require some retroactive patching of the 2.8.4 tag no matter who does it). Sadly, I believe it is not trivial to install a new pywin32 build into a Zope binary. You could patch it up though by opening the pywin32 release executable in WinZip (or similar), then replacing 'pywintypes.py' and extracting a new _win32sysloader.pyd module. Ya, like Windows users are gonna do _that_ wink. Finally, I believe another way to solve this problem would be to remove pywintypes23.dll from the system32 directory (the the underlying problem is that 2 copies of this DLL are being loaded into memory). However, doing this may prevent other things (such as your existing Python installation) from working correctly, so do this with caution. Zope does not install anything into system32, so presumably something else on your system is also using Python. All recent PySECURITY_ATTRIBUTES complaints I know about have come from people using both Zope and Plone. I don't know anything about Plone installation, but it's natural to suspect that Plone is the source of the other pywin32 installation, and possibly of compounding sys.path convolutions too. So, a natural question based on this ignorance: is it enough for just Zope to install build 205, if Plone also installs its own (older) pywin32 and mangles sys.path so that its pywin32 is also visible? I suspect (but don't know) that's what's happening. It would be a lot better if a Plone user tested the proposed solution before we release another Windows Zope that may still turn out not to solve Plone's problems here. __ Chris A. Mattmann [EMAIL PROTECTED] Staff Member Modeling and Data Management Systems Section (387) Data Management Systems and Technologies Group _ Jet Propulsion LaboratoryPasadena, CA Office: 171-266BMailstop: 171-246 ___ Disclaimer: The opinions presented within are my own and do not reflect those of either NASA, JPL, or the California Institute of Technology. ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Experiencing TypeError: The object is not a PySECURITY_ATTRIBUTES object
All recent PySECURITY_ATTRIBUTES complaints I know about have come from people using both Zope and Plone. I don't know anything about Plone installation, but it's natural to suspect that Plone is the source of the other pywin32 installation, and possibly of compounding sys.path convolutions too. So, a natural question based on this ignorance: is it enough for just Zope to install build 205, if Plone also installs its own (older) pywin32 and mangles sys.path so that its pywin32 is also visible? I suspect (but don't know) that's what's happening. When first reading this, I assumed we were talking about a Plone binary build - which the following all applies to: I believe the problem is that the Plone installer (like the Enfold Server) copies pywintypes23.dll etc to system32 as part of the install. This is evil and is being addressed. The issue isn't sys.path mangling as such, as pywintypes23.dll is never imported directly by Python (ie, no one ever imports a module of that name). The problem is that when pywintypes23.dll is in system32 *and* in the same directory as the executable, the following things can happen: 'import pywintypes' - pywintypes.py explicitly looked for and loaded pywintypes23.dll 'import win32api' - Windows looks for and loads pywintypes23.dll due to win32api.pyd using symbols from the DLL. The problem was that Windows was a little smarter than me :) If 'import pywintypes' has been done first, Windows would notice the module was already loaded, so 'import win32api' would happily use that. But when 'import win32api' happens first, Windows has already loaded pywintypes23.dll. If the 'import pywintypes' followed, we did *not* reuse the already loaded module - we (possibly) chose and loaded a new one. The fix in pywin32 was to use a special .pyd file that was capable of determining if pywintypes23.dll was already loaded, and if so, reuse that (ironically, win32api itself could do that if only it didn't depend on pywintypes23.dll itself! This new .pyd obviously does not depend on that DLL) Moving forward: I have fixed the Plone Community installer released by Enfold to copy nothing into system32, and confirmed that it does work even when the DLL exists in system32, and this should be released soon. I hope to give our commercial offering Enfold Server the same treatment very soon. The older plone installers will probably not be fixed. BUT - reading Chris's mail, it seems he installed a Zope binary package, and manually added the Plone products to it. In this case, I doubt Plone is mangling much, nor would it be copying pywintypes23.dll around. Thus, unless there was a pre-existing pywintypes23.dll in system32, I don't see how this problem could happen. I've asked Chris to let me know if there was that pre-existing DLL. It would be a lot better if a Plone user tested the proposed solution before we release another Windows Zope that may still turn out not to solve Plone's problems here. I've mailed Chris the 2 relevant updated files to see if his problem goes away. I guess that is a good start :) Cheers, Mark ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Experiencing TypeError: The object is not a PySECURITY_ATTRIBUTES object
Hi Mark, BUT - reading Chris's mail, it seems he installed a Zope binary package, and manually added the Plone products to it. In this case, I doubt Plone is mangling much, nor would it be copying pywintypes23.dll around. Thus, unless there was a pre-existing pywintypes23.dll in system32, I don't see how this problem could happen. I've asked Chris to let me know if there was that pre-existing DLL. I guess I should qualify the full process that I went through to arrive at the error I posted to the list. Before trying anything else, I first tried to install the Plone 2.1.1 Windows installer, which worked fine, mind you. Then, I ran into an error where my colleague and I were trying to do some code along the lines of: final = super(ATImage, self).SearchableText() + ' ' + ' '.join(names) which I guess the python version that Zope 2.7.8 uses doesn't support. Turns out that the windows installer on the plone.org site for plone version 2.1.1 includes Zope 2.7.8, which as I said, doesn't seem to support the above statement. So, in lieu of changing that code, my friend suggested upgrading to Zope 2.8.2, which supports the above code (I'm guessing b/c the Python version libraries included with that Zope can do the super() call). So, I uninstalled the Plone windows installer and set about on my path of running into the PySECURITY_ATTRIBUTES error with: Plone 2.1.1, just the products Zope 2.8.2, the tar.gz from the zope.org site And Python 2.3.5, from the python.org site So, it's entirely possible that even when I uninstalled the Plone 2.1.1 windows installer, that it didn't uninstall that pywintypes23.dll file that you mention the windows installer installs by default. So, that may be why I was seeing the error. I will report back soon on if I find that dll file in my system32 directory. I'll also report the results of your patch files applied to my environment, and whether they worked or not. Thanks a lot, again! Cheers, Chris It would be a lot better if a Plone user tested the proposed solution before we release another Windows Zope that may still turn out not to solve Plone's problems here. I've mailed Chris the 2 relevant updated files to see if his problem goes away. I guess that is a good start :) Cheers, Mark ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Experiencing TypeError: The object is not a PySECURITY_ATTRIBUTES object
Hi Mark, Success! That fixed the problem. Thanks for the excellent help. I'd say this patch is a good for the next iteration of builds ;) Take care, Chris __ Chris A. Mattmann [EMAIL PROTECTED] Staff Member Modeling and Data Management Systems Section (387) Data Management Systems and Technologies Group _ Jet Propulsion LaboratoryPasadena, CA Office: 171-266BMailstop: 171-246 ___ Disclaimer: The opinions presented within are my own and do not reflect those of either NASA, JPL, or the California Institute of Technology. -Original Message- From: Mark Hammond [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 4:00 PM To: Chris Mattmann Subject: RE: [Zope-dev] Experiencing TypeError: The object is not a PySECURITY_ATTRIBUTES object Hi Chris, You could try the solution with the attached files: pywintypes.py replaces an existing file in what I believe is the {zope}\bin\lib\site-packages\win32\lib directory. Please take a copy of the original in case I totally screw you :) _win32sysloader.pyd is a new file, and goes into the existing directory {zope}\bin\lib\site-packages\win32, where you should find many other .pyd files. Simply restart Zope after this, and the problems should vanish. Mark. -Original Message- From: Chris Mattmann [mailto:[EMAIL PROTECTED] Sent: Thursday, 27 October 2005 8:18 AM To: Tim Peters; Mark Hammond Cc: zope-dev@zope.org Subject: Re: [Zope-dev] Experiencing TypeError: The object is not a PySECURITY_ATTRIBUTES object Hi Guys, Thanks for your responses. I'll investigate the version of Plone that I had downloaded (2.1.1) to see whether or not there are any calls to the pywintypes32 library within the Plone products that could be causing this problem. I had suspected it may be a Plone issue because I didn't see the problem when I just installed Zope, and started it up. Only after adding the Plone products did I start to see the problem. However, I wasn't sure what might be causing it because I'm not really a Python guy. To be honest, I've never used it before. So I'll check into this and get back to you. I'd be happy to test the proposed solution BTW, if you send me a tarball, and report the results to the list. Thanks! Cheers, Chris On 10/26/05 3:00 PM, Tim Peters [EMAIL PROTECTED] wrote: [Mark Hammond] FYI, there is a new pywin32 build out now that should solve this problem without requiring any imports to be reordered. Yay! It would be great if whoever turns the crank for the next Zope/Windows builds (which may even turn out to be me! :) uses build 205. Andreas Jung made a surprise release of Zope 2.8.4 today, but only the tarball, not a Windows installer. If you want to make the latter, more than fine by me, else I'll try to make one tomorrow (with your build 205, of course -- will require some retroactive patching of the 2.8.4 tag no matter who does it). Sadly, I believe it is not trivial to install a new pywin32 build into a Zope binary. You could patch it up though by opening the pywin32 release executable in WinZip (or similar), then replacing 'pywintypes.py' and extracting a new _win32sysloader.pyd module. Ya, like Windows users are gonna do _that_ wink. Finally, I believe another way to solve this problem would be to remove pywintypes23.dll from the system32 directory (the the underlying problem is that 2 copies of this DLL are being loaded into memory). However, doing this may prevent other things (such as your existing Python installation) from working correctly, so do this with caution. Zope does not install anything into system32, so presumably something else on your system is also using Python. All recent PySECURITY_ATTRIBUTES complaints I know about have come from people using both Zope and Plone. I don't know anything about Plone installation, but it's natural to suspect that Plone is the source of the other pywin32 installation, and possibly of compounding sys.path convolutions too. So, a natural question based on this ignorance: is it enough for just Zope to install build 205, if Plone also installs its own (older) pywin32 and mangles sys.path so that its pywin32 is also visible? I suspect (but don't know) that's what's happening. It would be a lot better if a Plone user tested the proposed solution before we release another Windows Zope that may still turn out not to solve Plone's problems here. __ Chris A. Mattmann [EMAIL PROTECTED] Staff Member Modeling and Data Management Systems Section (387) Data Management Systems and Technologies Group
[Zope-dev] Re: New testrunner on the Zope 2 trunk.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: Weird. I can't reproduce this. Is anyone else seeing this? For the benefit of those playing along at home: Jim and I discovered this evening that we were running on mostly-identical platforms (Ubuntu Breezy 5.10, Python 2.3.5 compiled from source). The only difference we could find was that I had rebuilt my Pythnon using GCC 4.0, while Jim's was one built under GCC 3.3. Go figure, Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDYEk7+gerLs4ltQ4RAvy1AKDIg4aoolifM8sKb/SLZkr7VANfyQCgzboL tIBd+gk++ECvgONcouW7KPA= =wJEw -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Mountpoints
I lied. Due to completely preventable circumstances, this merge won't be done tonight; instead, it will be done tomorrow evening. - C On Mon, 2005-10-24 at 16:41 -0400, Tim Peters wrote: [Chris McDonough] Thanks for this! Not required, so long as I get to thank you for finishing it ;-) Looks like that test failure is incidental and not symptomatic of changes made to ZODB. I think Tres may have said that it can be fixed by merging in a fix from the Five HEAD, but I don't know this for fact first-hand. I'm sure that failure will go away by itself when you're working on the trunk instead of the branch. What I'd do now: - Check out Zope trunk. - Merge the branch into your trunk sandbox, and forget the branch. - Fix merge conflicts. I got one, in datatypes.py, and I didn't know immediately what to do about it so stopped there. You'll have better luck ;-). Note that, under SVN, after you fix a conflict, you have to do svn resolved path/to/conflicted/file; that's a gimmick to make sure you don't forget about conflicts. - svn up to make sure you've got all the externals the merged files point at. - svn up from time to time thereafter, to suck in other trunk changes as they get made. - Check it in when it's stable. - If it takes longer than expected, make a _new_ branch _from_ your merged-into-trunk local trunk sandbox. (That's easy: make a branch directory, svn switch to it from your local merged trunk sandbox, and svn commit -- all done). It's encouraging that most of the tests pass but there are a paucity of tests that specifically test Zope 2 multidatabase-based mount points. There are a few convincing-looking decoys in Products.ZODBMountPoint.tests but I think I'll need to create a few more to get the warm and fuzzies before doing the merge. As above, you can do a _local_ merge right away. This would save you from other decoys (like the DeprecationWarnings that would no longer exist if you were using the trunk instead of the brach, and the failing-on-branch-but-not-trunk Five test). I recall that, historically, the Zope tests never failed when Zope mounting was in fact broken, so a fat +1 to beefing test coverage there. I have this on my plate for Wednesday evening. Understood; there really isn't any good TV on Wednesdays anymore ;-) ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )