[Zope-Coders] Zope tests: 4 OK, 4 Failed
Summary of messages to the zope-tests list. Period Sun Sep 25 11:01:02 2005 UTC to Mon Sep 26 11:01:02 2005 UTC. There were 8 messages: 8 from Zope Unit Tests. Test failures - Subject: FAILED (failures=1) : Zope-2_8-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:32:19 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003179.html Subject: FAILED (failures=1) : Zope-2_8-branch Python-2.4.1 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:33:49 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003180.html Subject: FAILED (failures=1) : Zope-trunk Python-2.3.5 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:35:19 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003181.html Subject: FAILED (failures=1) : Zope-trunk Python-2.4.1 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:36:49 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003182.html Tests passed OK --- Subject: OK : Zope-2_6-branch Python-2.1.3 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:26:19 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003175.html Subject: OK : Zope-2_6-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:27:49 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003176.html Subject: OK : Zope-2_7-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:29:19 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003177.html Subject: OK : Zope-2_7-branch Python-2.4.1 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:30:49 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003178.html ___ Zope-Coders mailing list Zope-Coders@zope.org http://mail.zope.org/mailman/listinfo/zope-coders
[Zope-Coders] Re: Zope tests: 4 OK, 4 Failed
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Zope tests summarizer wrote: Summary of messages to the zope-tests list. Period Sun Sep 25 11:01:02 2005 UTC to Mon Sep 26 11:01:02 2005 UTC. There were 8 messages: 8 from Zope Unit Tests. Test failures - Subject: FAILED (failures=1) : Zope-2_8-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:32:19 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003179.html Subject: FAILED (failures=1) : Zope-2_8-branch Python-2.4.1 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:33:49 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003180.html Subject: FAILED (failures=1) : Zope-trunk Python-2.3.5 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:35:19 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003181.html Subject: FAILED (failures=1) : Zope-trunk Python-2.4.1 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:36:49 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003182.html Tests passed OK --- Subject: OK : Zope-2_6-branch Python-2.1.3 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:26:19 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003175.html Subject: OK : Zope-2_6-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:27:49 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003176.html Subject: OK : Zope-2_7-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:29:19 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003177.html Subject: OK : Zope-2_7-branch Python-2.4.1 : Linux From: Zope Unit Tests Date: Sun Sep 25 22:30:49 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003178.html These errors are my fault, I think: I changed the underlying 'publish_method' to behave correctly, i.e. not capturing exceptions when 'handle_errors' was passed as False. I'll look at this when I'm back in the states, unless somebody finds the test which expects an error page rather than an exception / traceback first, and either turns off 'handle_errors=False' or changes the expected output. Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDN9cZ+gerLs4ltQ4RAuZmAJ45zextAGP3n2chks93a3bkz4X03gCfXLTW PNCtB1cW0wZAhkiHk+XhuPg= =Qw8L -END PGP SIGNATURE- ___ Zope-Coders mailing list Zope-Coders@zope.org http://mail.zope.org/mailman/listinfo/zope-coders
[Zope-Coders] Re: Zope tests: 4 OK, 4 Failed
Tres Seaver wrote: These errors are my fault, I think: I changed the underlying 'publish_method' to behave correctly, i.e. not capturing exceptions when 'handle_errors' was passed as False. I'll look at this when I'm back in the states, unless somebody finds the test which expects an error page rather than an exception / traceback first, and either turns off 'handle_errors=False' or changes the expected output. The error occurs in Products/Five/tests/forms.txt, which means it needs to be fixed in the Five repository, not in the Zope repository (at least not permanently). Indeed nearly all the functional tests there set handle_errors=False, which can be dropped to handle this situation better. Alternatively the test can be altered to expect a Traceback ... Unauthorized. Martijn ___ Zope-Coders mailing list Zope-Coders@zope.org http://mail.zope.org/mailman/listinfo/zope-coders
[Zope-Coders] Re: Zope tests: 4 OK, 4 Failed
Martijn Pieters wrote: The error occurs in Products/Five/tests/forms.txt, which means it needs to be fixed in the Five repository, not in the Zope repository (at least not permanently). Indeed nearly all the functional tests there set handle_errors=False, which can be dropped to handle this situation better. Alternatively the test can be altered to expect a Traceback ... Unauthorized. I see you already checked in a fix to the Five codebase, but because you didn't propagate this to the Zope codebase the test fails there. I checked in a fix there before I learned of you Five checkin. Here is my patch, which changes the test to expect Unauthorized to be raised: --- lib/python/Products/Five/tests/forms.txt(revision 38617) +++ lib/python/Products/Five/tests/forms.txt(working copy) @@ -36,8 +36,9 @@ ... GET /test_folder_1_/ftf/+/protectedaddform.html HTTP/1.1 ... Authorization: Basic viewer:secret ... , handle_errors=False) - HTTP/1.1 401 Unauthorized + Traceback (most recent call last): ... + Unauthorized: ... Now let's add a piece of our sample content object to test more things on it: This is the direct opposite of your fix in the Five codebase, where you removed the handle_errors=False flag instead. I assumed the keyword was there for a reason (propagate unexpected exceptions during testing?) so I used the Traceback approach instead. Do the Five ppl want this approach instead? If not, just ignore my change to the Zope codebase and have a future version of Five overwrite it. Martijn ___ Zope-Coders mailing list Zope-Coders@zope.org http://mail.zope.org/mailman/listinfo/zope-coders
Re: [Zope-dev] Problems adding many objects
Hi Morten, You'd probably need to show us the implementation of whatever manage_add_issue is. - C On Sep 25, 2005, at 10:09 AM, Morten W. Petersen wrote: Hi, I've created a script that imports XML into the ZODB, using regular TTW methods - and all is fine, except for when I import large files, with many objects. After about 288 objects, the import fails when the method that adds an object in the ZODB returns None, instead of the object it added. From what I can tell, the added object is not None before it is returned, but the name object, set via the expression object = self.manage_add_issue(...) is None. So it looks like somewhere between 'return issue_' in manage_add_issue and the expression above, the object is lost. Any ideas what could be happening here? I've managed to work around it for now, but it is interesting nonetheless. Regards, Morten morten.vcf ___ 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 ) ___ 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] Problems adding many objects
Chris, the implementation looks like this def manage_add_issue(self, id=None, title='', contents='', state='', type='', referrer='', format=None, REQUEST=None): Add an Issue. if id is None: id = self.get_unique_id() issue_ = issue(id, title, contents, state, type, creator=self.get_user().get_id(), owner=self.get_user().get_id(), format=format or self.get_user_preferences().issue_format) self._setObject(id, issue_) self.order.append(issue_.id) self.order = self.order issue_ = self[id] issue_.version = self.get_issue_dealer().version try: self.index_object() except AttributeError: pass if referrer and REQUEST is not None: REQUEST.RESPONSE.redirect(referrer) print 'redirect' else: if REQUEST is not None: if self.inCMF(): print 'admin url' return self.get_admin_url() else: print 'manage_main' return self.manage_main(self, REQUEST) else: print 'returning issue', issue_ return issue_ and before returning none, it says 'returning issue' on stdout. -Morten Chris McDonough wrote: Hi Morten, You'd probably need to show us the implementation of whatever manage_add_issue is. - C On Sep 25, 2005, at 10:09 AM, Morten W. Petersen wrote: Hi, I've created a script that imports XML into the ZODB, using regular TTW methods - and all is fine, except for when I import large files, with many objects. After about 288 objects, the import fails when the method that adds an object in the ZODB returns None, instead of the object it added. From what I can tell, the added object is not None before it is returned, but the name object, set via the expression object = self.manage_add_issue(...) is None. So it looks like somewhere between 'return issue_' in manage_add_issue and the expression above, the object is lost. Any ideas what could be happening here? I've managed to work around it for now, but it is interesting nonetheless. Regards, Morten morten.vcf ___ 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 ) -- Regards, Morten Tlf: +47 45 44 00 69 Blog: http://www.blogologue.com begin:vcard fn:Morten Petersen n:Petersen;Morten org:Nidelven IT adr:;;Postboks 923;Trondheim;;7409;Norway email;internet:[EMAIL PROTECTED] title:Project Manager tel;work:+47 45 44 00 69 tel;cell:+47 45 44 00 69 x-mozilla-html:FALSE url:http://www.nidelven-it.no version:2.1 end:vcard ___ 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] Problems adding many objects
On Sep 26, 2005, at 7:21 AM, Morten W. Petersen wrote: Chris, the implementation looks like this def manage_add_issue(self, id=None, title='', contents='', state='', type='', referrer='', format=None, REQUEST=None): Add an Issue. if id is None: id = self.get_unique_id() issue_ = issue(id, title, contents, state, type, creator=self.get_user().get_id(), owner=self.get_user().get_id(), format=format or self.get_user_preferences().issue_format) self._setObject(id, issue_) self.order.append(issue_.id) self.order = self.order issue_ = self[id] issue_.version = self.get_issue_dealer().version try: self.index_object() except AttributeError: pass if referrer and REQUEST is not None: REQUEST.RESPONSE.redirect(referrer) print 'redirect' else: if REQUEST is not None: if self.inCMF(): print 'admin url' return self.get_admin_url() else: print 'manage_main' return self.manage_main(self, REQUEST) else: print 'returning issue', issue_ return issue_ and before returning none, it says 'returning issue' on stdout. It doesn't say returning issue, None? My guess is that the if request is not none branch is called and it goes that way. But there's no way to know for sure without running it. This is a good place to use the Python debugger... as the first line of this method, insert import pdb; pdb.set_trace(), then start up Zope in the foreground (runzope or zopectl fg), then cause the method to be invoked through a browser. On the console you will see a pdb prompt. You can step through the code by using n. To print the value of a variable type p variablename, to step in to a function call press s. When you're finished, press c to continue or q to quit. This will be the fastest way to see what's happening in this method. - C -Morten Chris McDonough wrote: Hi Morten, You'd probably need to show us the implementation of whatever manage_add_issue is. - C On Sep 25, 2005, at 10:09 AM, Morten W. Petersen wrote: Hi, I've created a script that imports XML into the ZODB, using regular TTW methods - and all is fine, except for when I import large files, with many objects. After about 288 objects, the import fails when the method that adds an object in the ZODB returns None, instead of the object it added. From what I can tell, the added object is not None before it is returned, but the name object, set via the expression object = self.manage_add_issue(...) is None. So it looks like somewhere between 'return issue_' in manage_add_issue and the expression above, the object is lost. Any ideas what could be happening here? I've managed to work around it for now, but it is interesting nonetheless. Regards, Morten morten.vcf ___ 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 ) -- Regards, Morten Tlf: +47 45 44 00 69 Blog: http://www.blogologue.com morten.vcf ___ 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 )
[Fwd: Re: [Zope-dev] Problems adding many objects]
Oops, one for the list as well. Original Message Subject: Re: [Zope-dev] Problems adding many objects Date: Mon, 26 Sep 2005 13:34:50 +0200 From: Morten W. Petersen [EMAIL PROTECTED] To: Chris McDonough [EMAIL PROTECTED] References: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] It doesn't say returning issue, None? My guess is that the if request is not none branch is called and it goes that way. But there's no way to know for sure without running it. It says 'returning issue issue at x' This is a good place to use the Python debugger... as the first line of this method, insert import pdb; pdb.set_trace(), then start up Zope in the foreground (runzope or zopectl fg), then cause the method to be invoked through a browser. On the console you will see a pdb prompt. You can step through the code by using n. To print the value of a variable type p variablename, to step in to a function call press s. When you're finished, press c to continue or q to quit. This will be the fastest way to see what's happening in this method. Yep, I'll have a go at this later. Thanks for describing the debug process. :) -Morten -- Regards, Morten Tlf: +47 45 44 00 69 Blog: http://www.blogologue.com begin:vcard fn:Morten Petersen n:Petersen;Morten org:Nidelven IT adr:;;Postboks 923;Trondheim;;7409;Norway email;internet:[EMAIL PROTECTED] title:Project Manager tel;work:+47 45 44 00 69 tel;cell:+47 45 44 00 69 x-mozilla-html:FALSE url:http://www.nidelven-it.no version:2.1 end:vcard ___ 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 )
[Zope-dev] Re: SVN: Zope/branches/Zope-2_8-branch/ - Collector #1879: applied patch by Dieter Maurer to fix a bug in
This is the kind of thing that would *really* benefit from having unit tests... Florent Andreas Jung [EMAIL PROTECTED] wrote: Log message for revision 38586: - Collector #1879: applied patch by Dieter Maurer to fix a bug in ac_aquire() ignoring the default argument Changed: U Zope/branches/Zope-2_8-branch/doc/CHANGES.txt U Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c -=- Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt === --- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-09-24 12:01:37 UTC (rev 38585) +++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-09-24 12:10:07 UTC (rev 38586) @@ -31,6 +31,9 @@ Bugs Fixed + - Collector #1879: applied patch by Dieter Maurer to fix a bug in +ac_aquire() ignoring the default argument + - Collector #1864, #1906: fixed header normalization in appendHeader() - Collector #1899: fixed migration issue when using export/import for Modified: Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c === --- Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c 2005-09-24 12:01:37 UTC (rev 38585) +++ Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c 2005-09-24 12:10:07 UTC (rev 38586) @@ -1059,6 +1059,7 @@ PyObject *expl=0, *defalt=0; int explicit=1; int containment=0; + PyObject *result; /* DM 2005-08-25: argument default ignored */ UNLESS (PyArg_ParseTupleAndKeywords( args, kw, O|i, acquire_args+1, @@ -1070,12 +1071,34 @@ if (filter==Py_None) filter=0; + /* DM 2005-08-25: argument default ignored -- fix it! */ +# if 0 return Wrapper_findattr(self,name,filter,extra,OBJECT(self),1, explicit || self-ob_type==(PyTypeObject*)Wrappertype, explicit, containment); +# else + result = Wrapper_findattr(self,name,filter,extra,OBJECT(self),1, + explicit || + self-ob_type==(PyTypeObject*)Wrappertype, + explicit, containment); + if (result == NULL defalt != NULL) { +/* as Python/bltinmodule.c:builtin_getattr turn + only 'AttributeError' into a default value, such + that e.g. ConflictError and errors raised by the filter + are not mapped to the default value. +*/ +if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + Py_INCREF(defalt); + result = defalt; +} + } + return result; +# endif } + static PyObject * Wrapper_inContextOf(Wrapper *self, PyObject *args) { -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ 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] Re: SVN: Zope/branches/Zope-2_8-branch/ - Collector #1879: applied patch by Dieter Maurer to fix a bug in
You could convince Dieter to write unittests for his patches :-) On the other side his patches are in 99% of the cases trustworthy. Otherwise this bug would remain open. -aj --On 26. September 2005 18:31:27 +0200 Florent Guillaume [EMAIL PROTECTED] wrote: This is the kind of thing that would *really* benefit from having unit tests... Florent Andreas Jung [EMAIL PROTECTED] wrote: Log message for revision 38586: - Collector #1879: applied patch by Dieter Maurer to fix a bug in ac_aquire() ignoring the default argument Changed: U Zope/branches/Zope-2_8-branch/doc/CHANGES.txt U Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c -=- Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt === --- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-09-24 12:01:37 UTC (rev 38585) +++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-09-24 12:10:07 UTC (rev 38586) @@ -31,6 +31,9 @@ Bugs Fixed + - Collector #1879: applied patch by Dieter Maurer to fix a bug in +ac_aquire() ignoring the default argument + - Collector #1864, #1906: fixed header normalization in appendHeader() - Collector #1899: fixed migration issue when using export/import for Modified: Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c === --- Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c 2005-09-24 12:01:37 UTC (rev 38585) +++ Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c 2005-09-24 12:10:07 UTC (rev 38586) @@ -1059,6 +1059,7 @@ PyObject *expl=0, *defalt=0; int explicit=1; int containment=0; + PyObject *result; /* DM 2005-08-25: argument default ignored */ UNLESS (PyArg_ParseTupleAndKeywords( args, kw, O|i, acquire_args+1, @@ -1070,12 +1071,34 @@ if (filter==Py_None) filter=0; + /* DM 2005-08-25: argument default ignored -- fix it! */ +# if 0 return Wrapper_findattr(self,name,filter,extra,OBJECT(self),1, explicit || self-ob_type==(PyTypeObject*)Wrappertype, explicit, containment); +# else + result = Wrapper_findattr(self,name,filter,extra,OBJECT(self),1, + explicit || + self-ob_type==(PyTypeObject*)Wrappertype, + explicit, containment); + if (result == NULL defalt != NULL) { +/* as Python/bltinmodule.c:builtin_getattr turn + only 'AttributeError' into a default value, such + that e.g. ConflictError and errors raised by the filter + are not mapped to the default value. +*/ +if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + Py_INCREF(defalt); + result = defalt; +} + } + return result; +# endif } + static PyObject * Wrapper_inContextOf(Wrapper *self, PyObject *args) { -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ 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 ) pgpdZrH2tR5rm.pgp Description: 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 )
[Zope-dev] Z SQL Caching
Title: Z SQL Caching Hi all, I have a Z SQL method that is currently returning around 25000 rows. Is there a way to see if it is pulling that data from the cache or is doing a refresh? Alternatively, and maybe this will answer the first question, the Z SQL method is run essentially twice, each time with different parameters. Does it cache each instance, or does it cache the first, then when it's run again with different parameters, kill the cache and re-run everything? Thanks, Dale Hirt ___ 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 )
[Zope-dev] Re: Z SQL Caching
Dale Hirt wrote: I have a Z SQL method that is currently returning around 25000 rows. Is there a way to see if it is pulling that data from the cache or is doing a refresh? Alternatively, and maybe this will answer the first question, the Z SQL method is run essentially twice, each time with different parameters. Does it cache each instance, or does it cache the first, then when it's run again with different parameters, kill the cache and re-run everything? A ZSQLMethod cache (if configured with a cache duration greater than 0) is keyed on the rendered SQL. So, if different parameters lead to a different SQL query to be sent to the database, then a different key is used. Caches are kept for the duration of the configured cache duration, and a given cache key will not influence earlier caches of different keys. The SQL is taken quite literally here. If you use the following template: SELECT * FROM foo WHERE dtml-sqltest bar type=nb Then different values for 'bar' will result in different SQL queries and thus different cache keys. If the same method is called with the same value for 'bar' within the cache duration, an earlier cached result will be returned instead of querying the database. Another value for 'bar' in between those calls will not kill the cache. Martijn Pieters ___ 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] Re: Z SQL Caching
Thank you, Martijn. That makes it very clear. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Martijn Pieters Sent: Monday, September 26, 2005 11:49 AM To: zope-dev@zope.org Subject: [Zope-dev] Re: Z SQL Caching Dale Hirt wrote: I have a Z SQL method that is currently returning around 25000 rows. Is there a way to see if it is pulling that data from the cache or is doing a refresh? Alternatively, and maybe this will answer the first question, the Z SQL method is run essentially twice, each time with different parameters. Does it cache each instance, or does it cache the first, then when it's run again with different parameters, kill the cache and re-run everything? A ZSQLMethod cache (if configured with a cache duration greater than 0) is keyed on the rendered SQL. So, if different parameters lead to a different SQL query to be sent to the database, then a different key is used. Caches are kept for the duration of the configured cache duration, and a given cache key will not influence earlier caches of different keys. The SQL is taken quite literally here. If you use the following template: SELECT * FROM foo WHERE dtml-sqltest bar type=nb Then different values for 'bar' will result in different SQL queries and thus different cache keys. If the same method is called with the same value for 'bar' within the cache duration, an earlier cached result will be returned instead of querying the database. Another value for 'bar' in between those calls will not kill the cache. Martijn Pieters ___ 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 ) ___ 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] I still can't load Zope at start up on a Mac OS X Server
Hi, Garito wrote: Hi all Now I'm trying launchd method I have: lanunchd[309]: ZopeSistes: respawning too quickly! throtting or exits with exit code: 1 errors at system.log (it depends how I launch zope) Yep, your Zope is dying. Try just using runzope with debug-mode on in zope.conf and maybe it'll give you an idea of what's failing... 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] How to create an ansynchronous method
David Pratt wrote: really interesting.I think it would be a really good thing to see fire and forget with a process you create as a series of steps that can also be queued in one or more queues. Well, I think ZAsync would be great for building and managing the queues, with Stepper steps being used to process them... I also think there is some interesting possibility for something like a Zope instance Stepper where you could trigger a generic daemon to run a thread to process asynchronous tasks (steps) without a ZEO requirement. Huh? That made no sense. Spawning new ZServer threads is evil, I like the fact that Stepper keeps it simple and connects to a ZEO server. It means Stepper can be run from any normal Zope client build and doesn't need to do anything funky. The asynchronous jobs could be queued for long running tasks outside of zope or timed to inject the step requests into zope for the maintenance of a zope instance (in the same vein as ClockServer) but in a single product. I think a combination of Stepper and ZAsync could meet your needs, when you hit specific problems which you need help with, let me or Gary know :-) 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 )
[Zope] LAN access and session timeout?
Hi guys, I installed ZOPE on my PC with a WIN XP operating system. I connected this computer to another one with the same operating system. Everything works fine except the fact that after a certain time period, I am not able to have access to the ZOPE server through the connected (2nd) computer anymore. Do you know what the problem is? I already tried to change the .conf file of my instance by replacing the timeout-minutes option - but it did not work. sincerely, Benjamin _ Mit der Gruppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179 ___ 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] Parse a XML file in Zope, zopeXMLmethods Product not working in Zope 2.8.1
Hello, I've a xml file on the file system (the source is on an other webserver and the download is scheduled). How ca I parse this file with a xslt in Zope. ZopeXMLmethods isn't working annymore in Zope 2.8.1. Does annyone knows a Product of method to parse xml in Zope without the zopeXMLmethods product ? Regards, Martin Koekenberg ___ 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: [***SPAM*** Score/Req: 04.00/04.00] Re: [Zope] I still can't load Zope at start up on a Mac OS X Server
Chris Withers escribió: Hi, Garito wrote: Hi all Now I'm trying launchd method I have: lanunchd[309]: ZopeSistes: respawning too quickly! throtting or exits with exit code: 1 errors at system.log (it depends how I launch zope) Yep, your Zope is dying. Try just using runzope with debug-mode on in zope.conf and maybe it'll give you an idea of what's failing... cheers, Chris Sorry but if I launch it manually (zopectl start) it works fine cheers! -- Mis Cosas http://blogs.sistes.net/Garito/ ___ 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] Parse a XML file in Zope, zopeXMLmethods Product not working in Zope 2.8.1
Martin Koekenberg escribió: Hello, I've a xml file on the file system (the source is on an other webserver and the download is scheduled). How ca I parse this file with a xslt in Zope. ZopeXMLmethods isn't working annymore in Zope 2.8.1. Does annyone knows a Product of method to parse xml in Zope without the zopeXMLmethods product ? Regards, Martin Koekenberg ___ 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 ) Hi! I use xml.dom.minidom Alternatives? Thanks! -- Mis Cosas http://blogs.sistes.net/Garito/ ___ 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] Parse a XML file in Zope, zopeXMLmethods Product not working in Zope 2.8.1
Am Montag, 26. September 2005 15:57 schrieb Martin Koekenberg: Hello, I've a xml file on the file system (the source is on an other webserver and the download is scheduled). How ca I parse this file with a xslt in Zope. ZopeXMLmethods isn't working annymore in Zope 2.8.1. Does annyone knows a Product of method to parse xml in Zope without the zopeXMLmethods product ? Regards, Martin Koekenberg I do it like this (ExternalMethod in this case): import libxml2 import libxslt stylestring = file(/path/to/style/file.xsl).read() def xslt(data): # note: if styledoc and style are defined outside the function, # zope dumps core :-( styledoc = libxml2.parseDoc(stylestring) style = libxslt.parseStylesheetDoc(styledoc) doc = libxml2.parseDoc(data) result = style.applyStylesheet(doc, None) html = style.saveResultToString(result) style.freeStylesheet() doc.freeDoc() result.freeDoc() return html may be not very smart, but it's working :-) Cheers, Sascha ___ 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] Using the set object within page templates
How can I use a set object within a page template? When I attempt to create a set (e.g. tal:define=myset python:set(some_list)), zope complains that the name 'set' is not defined. 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] Using the set object within page templates
Python sets are not available from with ZPT since ZPT and PythonScripts run within a sandbox. Write an external method or move your code to trusted code (Zope product). -aj --On 26. September 2005 13:38:55 -0500 Floyd May [EMAIL PROTECTED] wrote: How can I use a set object within a page template? When I attempt to create a set (e.g. tal:define=myset python:set(some_list)), zope complains that the name 'set' is not defined. 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 ) pgphoc0s3dS1Z.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] Parse a XML file in Zope, zopeXMLmethods Product not working in Zope 2.8.1
Martin Koekenberg wrote at 2005-9-26 15:57 +0200: ... Does annyone knows a Product of method to parse xml in Zope without the zopeXMLmethods product ? You can use any of the methods for XML parsing supported by Python, among others * MiniDOM * [c]ElementTree * SAX * pyexpat * sgmlop * libxml2 Note that the listed options operate on different API levels (DOM, SAX, raw parsing events). -- Dieter ___ 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] LAN access and session timeout?
Benmania Guin wrote at 2005-9-26 15:34 +0200: I installed ZOPE on my PC with a WIN XP operating system. I connected this computer to another one with the same operating system. Everything works fine except the fact that after a certain time period, I am not able to have access to the ZOPE server through the connected (2nd) computer anymore. Do you know what the problem is? No, but apparently, it has nothing to do with the session timeout. Do you say that you can connect Zope from the first but not any more from the second computer? That would be *very* strange as Zope does (by default) not destinquish requests according to their source (all requests look equal to Zope whether they come from your first or second computer). It would indicate more a problem with your environment than with Zope. -- Dieter ___ 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 to store in a RAM cache a list of objects?
Ausum Studio wrote at 2005-9-26 03:19 -0500: I'd like to RAM cache the result of a long-runing ZopeFind method, formatted to a plain list of objects. But the RAM cache doesn't store the list and hence every time the supossedly cached method is called, the ZopeFind process id triggered. Other data (like the lenght of the resulting list) is stored and retrieved with no problem, telling by the cache manager's stats tab. Is that normal behaviour of the RAM cache machinery? It is very dangerous (and almost impossible) to cache persistent objects outside of their ZODB connection. The RAM Cache Manager knows about this danger and tries to make sure, it caches only simple objects (not sure that it catches persistent objects). For this reason, you cannot cache the full result of a ZopeFind. However, you can cache the paths part of it. -- Dieter ___ 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] Using the set object within page templates
Is there no way to allow sets to be used within templates/scripts? fm Andreas Jung [EMAIL PROTECTED] 9/26/2005 1:41:18 PM Python sets are not available from with ZPT since ZPT and PythonScripts run within a sandbox. Write an external method or move your code to trusted code (Zope product). -aj --On 26. September 2005 13:38:55 -0500 Floyd May [EMAIL PROTECTED] wrote: How can I use a set object within a page template? When I attempt to create a set (e.g. tal:define=myset python:set(some_list)), zope complains that the name 'set' is not defined. 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 ) ___ 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] Using the set object within page templates
--On 26. September 2005 13:52:16 -0500 Floyd May [EMAIL PROTECTED] wrote: Is there no way to allow sets to be used within templates/scripts? As I said: No, by default. Look at lib/python/Products/PythonScripts/README.txt. -aj pgpj6IBRvuIhK.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 )
[Zope] Page Template security problem
I'm having a problem figuring out how to keep things secure while allowing a proxied script to call a page template correctly. /details/sendDetails Python script that is publicly available, receives an email address and sends that person thier details stored in the database. The script has proxy rights of Administrator. /admin/person/emaildetails.htm Page template that is secured (admin folder is Administrator only for view and access contents information). The anonymous user is prompted for authentication. If I change emaildetails.htm to a simple test text file it works, the problem seems to lie when the template tries to access any script from the context. I tried to give those scripts proxy rights too but that had no effect. Am I going about this the wrong way, is there something I missed, or am I just going to have to revert to rewriting the whole details.htm as DTML? ___ 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] Page Template security problem
--On 27. September 2005 16:54:05 +1200 Chris Beaven [EMAIL PROTECTED] wrote: The anonymous user is prompted for authentication. Install VerboseSecurity and look at the output of VS. -aj pgpZnDneG6HFd.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 )