[Zope] Re: DateTime mess
[ Florent Guillaume wrote:] Jürgen Herrmann wrote: recently i came up here with the intention to fix DateTime#strftime(). while trying this, i had to dig deeper and deeper into the implementation of DateTime and especially the timezone and daylight saving stuff. to be honest, it's completely hacked together :( DateTimeZone.py has one BIG dictionary in it, not a single line of comments. values of this dict are nested lists, among other hackish things (list like usage of a string, with \000 as separator). the methods that use this dict also have no comments/docstrings at all. obviously the guy(s) that originally wrote this, is/are hiding (i know why :) so, there's nobody to ask either... sorry guys, i won't be able to completely fix this for now. i found a way to monkey patch zope to make it work for my case (2 timezones only). my plan is to completely reimplement DateTime, based on python's datetime in my own freetime (maybe around xmas this year) and give it back to the community. once again sry, if i raised expectations on the fix of strftime. Yes replacing DateTime is a laudable but difficult goal. One thing that could be done meanwhile is just refactor the unit test to be a base class that could then be used to test DateTime or to test another potential implementation. That would go a long way to help actually write a new implementation. Florent hi florent! actually that's the best thing to do! this way the implementer knows what to do exactly :) but be aware that some tests got modified to pass with current (broken) behaviour! one more question (to the public!): do we REALLY need dates 1900 / 2036 ? using unix timestamps for storage and as the base for all conversions would make things a lot easier! regards, juergen herrmann ___ XLhost.de - eXperts in Linux hosting Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.de ___ 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: DateTime mess
On 11/22/05, Jürgen Herrmann [EMAIL PROTECTED] wrote: do we REALLY need dates 1900 / 2036 ? Yes. using unix timestamps for storage and as the base for all conversions would make things a lot easier! datetimes are picklable, so if you are going to change how they are stored (which may not be a good idea for backwards compatible reasons), you should use that. -- 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] Re: DateTime mess
[ Lennart Regebro wrote:] On 11/22/05, Jürgen Herrmann [EMAIL PROTECTED] wrote: do we REALLY need dates 1900 / 2036 ? Yes. using unix timestamps for storage and as the base for all conversions would make things a lot easier! datetimes are picklable, so if you are going to change how they are stored (which may not be a good idea for backwards compatible reasons), you should use that. i'll surely change the storage format, when rewriting it! storing year, month, day, hour, minute, second, a unix timestamp and tzinfo is plain odd! so using a datetime instance for storage indeed seems the most obvious thing if we need dates 1900 / 2036. regards, juergen herrmann ___ XLhost.de - eXperts in Linux hosting Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.de ___ 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: DateTime mess
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jürgen Herrmann wrote: [ Florent Guillaume wrote:] Jürgen Herrmann wrote: recently i came up here with the intention to fix DateTime#strftime(). while trying this, i had to dig deeper and deeper into the implementation of DateTime and especially the timezone and daylight saving stuff. to be honest, it's completely hacked together :( DateTimeZone.py has one BIG dictionary in it, not a single line of comments. values of this dict are nested lists, among other hackish things (list like usage of a string, with \000 as separator). the methods that use this dict also have no comments/docstrings at all. obviously the guy(s) that originally wrote this, is/are hiding (i know why :) so, there's nobody to ask either... sorry guys, i won't be able to completely fix this for now. i found a way to monkey patch zope to make it work for my case (2 timezones only). my plan is to completely reimplement DateTime, based on python's datetime in my own freetime (maybe around xmas this year) and give it back to the community. once again sry, if i raised expectations on the fix of strftime. Yes replacing DateTime is a laudable but difficult goal. One thing that could be done meanwhile is just refactor the unit test to be a base class that could then be used to test DateTime or to test another potential implementation. That would go a long way to help actually write a new implementation. Florent hi florent! actually that's the best thing to do! this way the implementer knows what to do exactly :) but be aware that some tests got modified to pass with current (broken) behaviour! one more question (to the public!): do we REALLY need dates 1900 / 2036 ? using unix timestamps for storage and as the base for all conversions would make things a lot easier! Yes, we do need them. The Unix timestamp epoch starts at 1970, BTW. 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 iD8DBQFDgwz0+gerLs4ltQ4RAt95AJ9yGr7egzS6Fb6/Tlq3d196CccA1gCgkZeO Zs+XUWMJ9QhG8G4XRTOUF0k= =GaZ6 -END 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] Re: DateTime mess
On 11/22/05, Jürgen Herrmann [EMAIL PROTECTED] wrote: i'll surely change the storage format, when rewriting it! So you plan on having some version marker, or so, which tells which storage format is used? //Curious. -- 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] Re: DateTime mess
[ Lennart Regebro wrote:] On 11/22/05, Jürgen Herrmann [EMAIL PROTECTED] wrote: i'll surely change the storage format, when rewriting it! So you plan on having some version marker, or so, which tells which storage format is used? //Curious. basicall i thought about having a dateime instance as storage in the new implementation and test for it's existance on DateTime instances. something like that: dt = getattr(self, '_datetime', None) if dt is not None: #new, everything ok else: #migrate! rfc! regards, juergen herrmann ___ XLhost.de - eXperts in Linux hosting Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.de ___ 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] Proxy setting for Zope and Products
Hello all, I'm responsible of a server (Debian Sarge) which has been put behind a firewall! I am strugling with proxy problems. For instance, CMFSin doesn't seem to work (for syndication slots in Plone), and LDAPUserFolder cannot reach an external ldap server. On the system itself, I have set the http_proxy environment variable (in .bashrc), it works fine for apt-get, for example, but it seems it has no effect on Zope! Do you have any idea if there is a way to inform directly Zope and all its products about a proxy in a simple way, or only products that are proxy-aware can be set to work in such an environment? Thanks in advance! serge ___ 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] unlinking stale socket?
Hi My zopeinstance went down and I was getting an 'upstream server' unknown message from apache. On restarting zope from ./zopectl this was the message I got. unlinking stale socket /home/zopeinstance/var/zopectl/sock,sleep/ No handlers could be found for logger 'root' Does anyone have any idea on how to prevent this at all, or what happened here? Thanks Michael ___ 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] unlinking stale socket?
Note that Zope likely started. Did it? Did you try zopectl stop and zopectl start again? If so, did it work? - C On Nov 22, 2005, at 9:52 AM, michael nt milne wrote: Hi My zopeinstance went down and I was getting an 'upstream server' unknown message from apache. On restarting zope from ./zopectl this was the message I got. unlinking stale socket /home/zopeinstance/var/zopectl/sock,sleep/ No handlers could be found for logger 'root' Does anyone have any idea on how to prevent this at all, or what happened here? Thanks Michael ___ 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] unlinking stale socket?
Yes, I noticed that the deamon wasn't running and so re-started it. It started up fine but that was the message I received. Just wondered what happened etc.. On 11/22/05, Chris McDonough [EMAIL PROTECTED] wrote: Note that Zope likely started.Did it?Did you try zopectl stop andzopectl start again?If so, did it work? - COn Nov 22, 2005, at 9:52 AM, michael nt milne wrote: Hi My zopeinstance went down and I was getting an 'upstream server' unknown message from apache. On restarting zope from ./zopectl this was the message I got. unlinking stale socket /home/zopeinstance/var/zopectl/sock,sleep/ No handlers could be found for logger 'root' Does anyone have any idea on how to prevent this at all, or what happened here? Thanks Michael ___ 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] unlinking stale socket?
I think it probably was running after the first time you invoked it. The message is only informative, meaning that zopectl died unexpectly the last time it was run (without cleaning up after itself). It's not a fatal error or at least hasn't been whenever I've seen it. On Nov 22, 2005, at 10:57 AM, michael nt milne wrote: Yes, I noticed that the deamon wasn't running and so re-started it. It started up fine but that was the message I received. Just wondered what happened etc.. On 11/22/05, Chris McDonough [EMAIL PROTECTED] wrote: Note that Zope likely started. Did it? Did you try zopectl stop and zopectl start again? If so, did it work? - C On Nov 22, 2005, at 9:52 AM, michael nt milne wrote: Hi My zopeinstance went down and I was getting an 'upstream server' unknown message from apache. On restarting zope from ./zopectl this was the message I got. unlinking stale socket /home/zopeinstance/var/zopectl/sock,sleep/ No handlers could be found for logger 'root' Does anyone have any idea on how to prevent this at all, or what happened here? Thanks Michael ___ 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] unlinking stale socket?
Ok, but Zope and Apache were serving nothing until I re-started Zope. The server had died for some reason On 11/22/05, Chris McDonough [EMAIL PROTECTED] wrote: I think it probably was running after the first time you invoked it.The message is only informative, meaning that zopectl died unexpectly the last time it was run (without cleaning up after itself).It'snot a fatal error or at least hasn't been whenever I've seen it.On Nov 22, 2005, at 10:57 AM, michael nt milne wrote: Yes, I noticed that the deamon wasn't running and so re-started it. It started up fine but that was the message I received. Just wondered what happened etc.. On 11/22/05, Chris McDonough [EMAIL PROTECTED] wrote: Note that Zope likely started.Did it?Did you try zopectl stop and zopectl start again?If so, did it work? - C On Nov 22, 2005, at 9:52 AM, michael nt milne wrote: Hi My zopeinstance went down and I was getting an 'upstream server' unknown message from apache. On restarting zope from ./zopectl this was the message I got. unlinking stale socket /home/zopeinstance/var/zopectl/sock,sleep/ No handlers could be found for logger 'root' Does anyone have any idea on how to prevent this at all, or what happened here? Thanks Michael ___ 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] Re: DateTime mess
At Tuesday 22/11/2005 05:50, Jürgen Herrmann wrote: one more question (to the public!): do we REALLY need dates 1900 / 2036 ? using unix timestamps for storage and as the base for all conversions would make things a lot easier! Sure. What about birthdays of aged people? Long running forecasts? Gabriel Genellina Softlab SRL ___ 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] Proxy setting for Zope and Products
On 22 Nov 2005, at 15:38, Renfer Serge (EDU) wrote: Hello all, I'm responsible of a server (Debian Sarge) which has been put behind a firewall! I am strugling with proxy problems. For instance, CMFSin doesn't seem to work (for syndication slots in Plone), and LDAPUserFolder cannot reach an external ldap server. On the system itself, I have set the http_proxy environment variable (in .bashrc), it works fine for apt-get, for example, but it seems it has no effect on Zope! Do you have any idea if there is a way to inform directly Zope and all its products about a proxy in a simple way, or only products that are proxy-aware can be set to work in such an environment? There is no such setting and this problem has nothing to do with Zope. This is *purely* a firewall issue that needs to be solved by the firewall administrator with input from you. I don't know what CMFSin is or does, but at least for the LDAPUserFolder you probably know what LDAP server and port you want to connect to so you need to tell the firewall admin to allow that access. jens ___ 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] unlinking stale socket?
Yes, so something must have killed the server and shut it down leading to the stale socket message. However I guess without further checking through the server logs I won't find out exactly why etc.On 11/22/05, J Cameron Cooper [EMAIL PROTECTED] wrote:michael nt milne wrote: Ok, but Zope and Apache were serving nothing until I re-started Zope. The server had died for some reasonIndeed. And that's what it tells you with the unlinking stale socket:it was not shut down in an orderly manner previously.But that message says nothing about why. --jcc On 11/22/05, *Chris McDonough* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I think it probably was running after the first time you invoked it. The message is only informative, meaning that zopectl died unexpectly the last time it was run (without cleaning up after itself).It's not a fatal error or at least hasn't been whenever I've seen it. On Nov 22, 2005, at 10:57 AM, michael nt milne wrote: Yes, I noticed that the deamon wasn't running and so re-started it. It started up fine but that was the message I received. Just wondered what happened etc.. On 11/22/05, Chris McDonough [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Note that Zope likely started.Did it?Did you try zopectl stop and zopectl start again?If so, did it work? - C On Nov 22, 2005, at 9:52 AM, michael nt milne wrote: Hi My zopeinstance went down and I was getting an 'upstream server' unknown message from apache. On restarting zope from ./zopectl this was the message I got. unlinking stale socket /home/zopeinstance/var/zopectl/sock,sleep/ No handlers could be found for logger 'root' Does anyone have any idea on how to prevent this at all, or what happened here? Thanks Michael--Building Websites with Plonehttp://plonebook.packtpub.com/ Enfold Systems, LLChttp://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 )
Re: [Zope] Re: DateTime mess
On Nov 22, 2005, at 11:27 AM, Gabriel Genellina wrote: At Tuesday 22/11/2005 05:50, Jürgen Herrmann wrote: one more question (to the public!): do we REALLY need dates 1900 / 2036 ? using unix timestamps for storage and as the base for all conversions would make things a lot easier! Sure. What about birthdays of aged people? Long running forecasts? The first time I read this, I thought it said long-running people, which would be funnier. ;-) ___ 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.1, LocalFS, and the importance of _p_jar
I've encountered the issue described here: http://mail.zope.org/pipermail/zope/2005-August/161120.html on a recently upgraded Zope using LocalFS. I have tracked down the issue to the fact that the object that LocalFS hands to ZODB is a WrapperObject, and this object does not have an oid. This raises an AssertionError during the _commit method of ZODB.Connection. I have traced the code a little bit and I see that this block of code will be avoided for these objects if the objects do not appear in self._registered_objects, which I can achieve by making sure that the object has no _p_jar attribute. If I comment out the line in the LocalFS object where the wrapper object's _p_jar is set to the parent object's _p_jar, everything works fine, with no (apparent) problems. [ I tried also setting obj._p_oid = self._p_oid, but then Zope has pickling problems trying to pickle instances of the wrapper class ]. The problem I have with my solution is that I have no clue what _p_jar is. What is _p_jar used for within the Zope model? What are the implications of having an object with self._p_jar=None? What are the implications of a transient object (not stored in the ZODB but on the local filesystem), with self._p_jar=None? Thanks in advance for any information, John Ziniti ___ 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] DateTime mess
Jürgen Herrmann wrote at 2005-11-21 10:33 +0100: ... difficult to understand timezone handling ... once again sry, if i raised expectations on the fix of strftime. I am a bit astonished that you need to understand timezone handling in order to implement an improved DateTime.strftime. The only thing strftime has to do with a timezone it to display it (when the format calls for it). For this, you simply ask the DateTime object for its timezone. -- 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] External Methods, Proxy Roles, and Executable Security
George Lee wrote at 2005-11-20 12:47 -0500: Is there much buzz about this in CMF developer land? Apart from regular problem reports (usually in the Plone mailing list), there are few talks about proxy roles. -- 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] cookie crumbler and error messages
paul hendrick wrote at 2005-11-21 14:44 +: Hi, thanks for the reply. I did what you asked and the error log produced these messages: Unauthorized: strongYou are not authorized to access this resource./strongp Username and password are not correct. Unauthorized: You are not allowed to access 'sql_select' in this context the sql_select error is because my .metadata file is denying requests to it for users with a certain role. no idea where to go from here i'm afraid There is another vital rule: whenever you see errors (more precisely exceptions), you should look (and report) the associated traceback. It tells you where the exception occured. What we know so far: the request tried to access sql_select and did not have the required permission. The traceback will tell you where this happens and this may help us to understand why it happens. -- 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] External Methods, Proxy Roles, and Executable Security
Jens Vagelpohl wrote at 2005-11-20 19:01 +0100: ... IMHO proxy roles should be used extremely sparingly, if at all. They are a last resort and I personally never use them. Matter of fact I believe having to use them means the application design could use some improvement... If something needs to be done with elevated privileges it should be in filesystem product code or, if that is not feasible, in an external method. At least that's my philosophy ;) You have lost the thread's start: George's problem has been that he could not move an object in an *EXTERNAL METHOD*, i.e. in trusted filesystem code. He would have the same problem in a filesystem product. The problem is that CopySupport performs a local security check (in _verifyObjectPaste) independent from its caller (it does not matter whether the rename/move/copy was called from trusted or untrusted code). With appropriate proxy roles, an untrusted Python Script can perform some rename/move/copy that trusted code is unable to perform. I assume you can agree that this is a somewhat unsane situation... -- 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 )
zope.app.application.HTTPPublicationRequestFactory interprets text/xml requests as XML-RPC (was: [Zope] Hard-coded Content-type:text/xml as xmlrpc in Zope (2.8.1))
John Ziniti wrote at 2005-11-21 15:04 -0500: ... Zope-2.8.1 now additionally has the zope.app.publication. HTTPPublicationRequestFactory class, which also assumes that text/xml means xmlrpc (in fact, it assumes that anything that startswith('text/xml') is an xmlrpc call). zope.app is part of Zope 3. You should complain about this misfeature on zope3-dev@zope.org. Definitely, there should not be a fixed (not configurable) association between text/xml requests and XML-RPC as text/xml can be interesting for the application and for SOAP. Not fixing old code which acts in strange hard-coded ways is something I understand, but adding new code that also acts that way seems like it is getting further away from good :) -- 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] External Methods, Proxy Roles, and Executable Security
On 22 Nov 2005, at 20:08, Dieter Maurer wrote: You have lost the thread's start: George's problem has been that he could not move an object in an *EXTERNAL METHOD*, i.e. in trusted filesystem code. He would have the same problem in a filesystem product. The problem is that CopySupport performs a local security check (in _verifyObjectPaste) independent from its caller (it does not matter whether the rename/move/copy was called from trusted or untrusted code). With appropriate proxy roles, an untrusted Python Script can perform some rename/move/copy that trusted code is unable to perform. I assume you can agree that this is a somewhat unsane situation... Yes, that's very odd... thanks for reminding me of the thread's start! jens ___ 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: [Zope3-dev] zope.app.application.HTTPPublicationRequestFactory interprets text/xml requests as XML-RPC (was: [Zope] Hard-coded Content-type:text/xml as xmlrpc in Zope (2.8.1))
--On 22. November 2005 20:37:16 +0100 Dieter Maurer [EMAIL PROTECTED] wrote: You should complain about this misfeature on zope3-dev@zope.org. Definitely, there should not be a fixed (not configurable) association between text/xml requests and XML-RPC as text/xml can be interesting for the application and for SOAP. For Zope 3.2 publishers are pluggable and can be configure through ZCML. The registration is based on the request method and mime-type. -aj pgpJYm3fGyR5V.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] Re: External Methods, Proxy Roles, and Executable Security
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jens Vagelpohl wrote: On 22 Nov 2005, at 20:08, Dieter Maurer wrote: You have lost the thread's start: George's problem has been that he could not move an object in an *EXTERNAL METHOD*, i.e. in trusted filesystem code. He would have the same problem in a filesystem product. The problem is that CopySupport performs a local security check (in _verifyObjectPaste) independent from its caller (it does not matter whether the rename/move/copy was called from trusted or untrusted code). With appropriate proxy roles, an untrusted Python Script can perform some rename/move/copy that trusted code is unable to perform. I assume you can agree that this is a somewhat unsane situation... Yes, that's very odd... thanks for reminding me of the thread's start! The actual problem here is a confusion of authorization with containment constraints: the CopySupport code is using a single check to test both, which makes it impossible to do the Right Thing (TM): either the proxy roles should be taken into account, in which case the containment constraint may be violated, or they shouldn't, in which case a proxy-role-granted script cannot be used to perform a controlled paste which would otherwise not be authorized. 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 iD8DBQFDg5LI+gerLs4ltQ4RAtblAJwNsXuSMgrSmuk5Jkx2dNvq5XcF+ACfVfli kWb4OErhWp0Zm95oGrNK+6o= =Thwe -END 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-Checkins] SVN: Zope/branches/Zope-2_8-branch/ Collector #1954: DocumentTemplate.DT_String: remove non-XHTML wart from error message.
Log message for revision 40315: Collector #1954: DocumentTemplate.DT_String: remove non-XHTML wart from error message. Changed: U Zope/branches/Zope-2_8-branch/doc/CHANGES.txt U Zope/branches/Zope-2_8-branch/lib/python/DocumentTemplate/DT_String.py -=- Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt === --- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-11-22 13:21:47 UTC (rev 40314) +++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-11-22 14:57:02 UTC (rev 40315) @@ -26,6 +26,9 @@ Bugs Fixed + - Collector #1954: DocumentTemplate.DT_String: remove non-XHTML +wart from error message. + - Fixed unclear security declarations. Warn when an attempt is made to have a security declaration on a nonexistent method. Modified: Zope/branches/Zope-2_8-branch/lib/python/DocumentTemplate/DT_String.py === --- Zope/branches/Zope-2_8-branch/lib/python/DocumentTemplate/DT_String.py 2005-11-22 13:21:47 UTC (rev 40314) +++ Zope/branches/Zope-2_8-branch/lib/python/DocumentTemplate/DT_String.py 2005-11-22 14:57:02 UTC (rev 40315) @@ -57,7 +57,7 @@ parse_error__roles__=() def parse_error(self, mess, tag, text, start): -raise ParseError, %s, for tag %s, on line %s of %sp % ( +raise ParseError, %s, for tag %s, on line %s of %s % ( mess, self.errQuote(tag), len(text[:start].split('\n')), self.errQuote(self.__name__)) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/DocumentTemplate/DT_String.py Forward port fix for Collector #1954 from 2.8 branch.
Log message for revision 40316: Forward port fix for Collector #1954 from 2.8 branch. Changed: U Zope/branches/2.9/lib/python/DocumentTemplate/DT_String.py -=- Modified: Zope/branches/2.9/lib/python/DocumentTemplate/DT_String.py === --- Zope/branches/2.9/lib/python/DocumentTemplate/DT_String.py 2005-11-22 14:57:02 UTC (rev 40315) +++ Zope/branches/2.9/lib/python/DocumentTemplate/DT_String.py 2005-11-22 15:03:40 UTC (rev 40316) @@ -57,7 +57,7 @@ parse_error__roles__=() def parse_error(self, mess, tag, text, start): -raise ParseError, %s, for tag %s, on line %s of %sp % ( +raise ParseError, %s, for tag %s, on line %s of %s % ( mess, self.errQuote(tag), len(text[:start].split('\n')), self.errQuote(self.__name__)) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/DocumentTemplate/DT_String.py Forward port fix for Collector #1954 from 2.8 branch.
Log message for revision 40317: Forward port fix for Collector #1954 from 2.8 branch. Changed: U Zope/trunk/lib/python/DocumentTemplate/DT_String.py -=- Modified: Zope/trunk/lib/python/DocumentTemplate/DT_String.py === --- Zope/trunk/lib/python/DocumentTemplate/DT_String.py 2005-11-22 15:03:40 UTC (rev 40316) +++ Zope/trunk/lib/python/DocumentTemplate/DT_String.py 2005-11-22 15:14:40 UTC (rev 40317) @@ -57,7 +57,7 @@ parse_error__roles__=() def parse_error(self, mess, tag, text, start): -raise ParseError, %s, for tag %s, on line %s of %sp % ( +raise ParseError, %s, for tag %s, on line %s of %s % ( mess, self.errQuote(tag), len(text[:start].split('\n')), self.errQuote(self.__name__)) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ Collector #1621: Added BBB alias for 'whrandom' in AccessControl/DTML.py and RestrictedPython/Utilities.py.
Log message for revision 40318: Collector #1621: Added BBB alias for 'whrandom' in AccessControl/DTML.py and RestrictedPython/Utilities.py. The alias will be removed in Zope 2.10. Collector #1894: updated docstrings, removing references to whrandom. Changed: U Zope/branches/Zope-2_8-branch/doc/CHANGES.txt U Zope/branches/Zope-2_8-branch/lib/python/AccessControl/DTML.py U Zope/branches/Zope-2_8-branch/lib/python/DocumentTemplate/DT_Util.py U Zope/branches/Zope-2_8-branch/lib/python/Products/PythonScripts/help/PythonScript.py U Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/Utilities.py -=- Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt === --- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-11-22 15:14:40 UTC (rev 40317) +++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-11-22 15:46:15 UTC (rev 40318) @@ -26,6 +26,10 @@ Bugs Fixed + - Collector #1621, #1894: Added BBB alias for 'whrandom' +in AccessControl/DTML.py and RestrictedPython/Utilities.py. The +alias will be removed in Zope 2.10. + - Collector #1954: DocumentTemplate.DT_String: remove non-XHTML wart from error message. Modified: Zope/branches/Zope-2_8-branch/lib/python/AccessControl/DTML.py === --- Zope/branches/Zope-2_8-branch/lib/python/AccessControl/DTML.py 2005-11-22 15:14:40 UTC (rev 40317) +++ Zope/branches/Zope-2_8-branch/lib/python/AccessControl/DTML.py 2005-11-22 15:46:15 UTC (rev 40318) @@ -15,11 +15,13 @@ $Id$ from DocumentTemplate import DT_Util -import SecurityManagement, string, math, whrandom, random +import SecurityManagement, string, math, random import DocumentTemplate.sequence from ZopeGuards import safe_builtins +whrandom = random # BBB: will be removed in Zope 2.10 + # RestrictedDTML is inserted by AccessControl.Implementation. @@ -27,7 +29,6 @@ DT_Util.TemplateDict.__allow_access_to_unprotected_subobjects__=1 string.__allow_access_to_unprotected_subobjects__=1 math.__allow_access_to_unprotected_subobjects__=1 -whrandom.__allow_access_to_unprotected_subobjects__=1 random.__allow_access_to_unprotected_subobjects__=1 DocumentTemplate.sequence.__allow_access_to_unprotected_subobjects__=1 Modified: Zope/branches/Zope-2_8-branch/lib/python/DocumentTemplate/DT_Util.py === --- Zope/branches/Zope-2_8-branch/lib/python/DocumentTemplate/DT_Util.py 2005-11-22 15:14:40 UTC (rev 40317) +++ Zope/branches/Zope-2_8-branch/lib/python/DocumentTemplate/DT_Util.py 2005-11-22 15:46:15 UTC (rev 40318) @@ -315,8 +315,11 @@ - Special security-aware versions of 'getattr' and 'hasattr', - - The Python 'string', 'math', and 'whrandom' modules, and + - The Python 'string', 'math', modules, + - BBB alias for the Python 'whrandom' module (will be removed in +Zope 2.10), + - A special function, 'test', that supports if-then expressions. The 'test' function accepts any number of arguments. If the first argument is true, then the second argument is returned, Modified: Zope/branches/Zope-2_8-branch/lib/python/Products/PythonScripts/help/PythonScript.py === --- Zope/branches/Zope-2_8-branch/lib/python/Products/PythonScripts/help/PythonScript.py 2005-11-22 15:14:40 UTC (rev 40317) +++ Zope/branches/Zope-2_8-branch/lib/python/Products/PythonScripts/help/PythonScript.py 2005-11-22 15:46:15 UTC (rev 40318) @@ -54,8 +54,11 @@ o math - o whrandom and random + o random + o whrandom (deprecated in Python; aliased BBB support will be +removed in Zope 2.10). + o Products.PythonScripts.standard o Because it allows you to execute arbitrary python code, the python Modified: Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/Utilities.py === --- Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/Utilities.py 2005-11-22 15:14:40 UTC (rev 40317) +++ Zope/branches/Zope-2_8-branch/lib/python/RestrictedPython/Utilities.py 2005-11-22 15:46:15 UTC (rev 40318) @@ -13,7 +13,7 @@ __version__='$Revision: 1.7 $'[11:-2] -import string, math, random, whrandom +import string, math, random import DocumentTemplate.sequence utility_builtins = {} @@ -21,7 +21,7 @@ utility_builtins['string'] = string utility_builtins['math'] = math utility_builtins['random'] = random -utility_builtins['whrandom'] = whrandom +utility_builtins['whrandom'] = random # BBB: will be removed in Zope 2.10 utility_builtins['sequence'] = DocumentTemplate.sequence try: ___ Zope-Checkins maillist -
[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/ Forward port fixes for collector #1621 and #1894 from the 2.8 branch.
Log message for revision 40319: Forward port fixes for collector #1621 and #1894 from the 2.8 branch. Changed: U Zope/branches/2.9/lib/python/AccessControl/DTML.py U Zope/branches/2.9/lib/python/DocumentTemplate/DT_Util.py U Zope/branches/2.9/lib/python/Products/PythonScripts/help/PythonScript.py U Zope/branches/2.9/lib/python/RestrictedPython/Utilities.py -=- Modified: Zope/branches/2.9/lib/python/AccessControl/DTML.py === --- Zope/branches/2.9/lib/python/AccessControl/DTML.py 2005-11-22 15:46:15 UTC (rev 40318) +++ Zope/branches/2.9/lib/python/AccessControl/DTML.py 2005-11-22 15:49:55 UTC (rev 40319) @@ -15,11 +15,13 @@ $Id$ from DocumentTemplate import DT_Util -import SecurityManagement, string, math, whrandom, random +import SecurityManagement, string, math, random import DocumentTemplate.sequence from ZopeGuards import safe_builtins +whrandom = random # BBB: will be removed in Zope 2.10 + # RestrictedDTML is inserted by AccessControl.Implementation. @@ -27,7 +29,6 @@ DT_Util.TemplateDict.__allow_access_to_unprotected_subobjects__=1 string.__allow_access_to_unprotected_subobjects__=1 math.__allow_access_to_unprotected_subobjects__=1 -whrandom.__allow_access_to_unprotected_subobjects__=1 random.__allow_access_to_unprotected_subobjects__=1 DocumentTemplate.sequence.__allow_access_to_unprotected_subobjects__=1 Modified: Zope/branches/2.9/lib/python/DocumentTemplate/DT_Util.py === --- Zope/branches/2.9/lib/python/DocumentTemplate/DT_Util.py2005-11-22 15:46:15 UTC (rev 40318) +++ Zope/branches/2.9/lib/python/DocumentTemplate/DT_Util.py2005-11-22 15:49:55 UTC (rev 40319) @@ -315,8 +315,11 @@ - Special security-aware versions of 'getattr' and 'hasattr', - - The Python 'string', 'math', and 'whrandom' modules, and + - The Python 'string', 'math', modules, + - BBB alias for the Python 'whrandom' module (will be removed in +Zope 2.10), + - A special function, 'test', that supports if-then expressions. The 'test' function accepts any number of arguments. If the first argument is true, then the second argument is returned, Modified: Zope/branches/2.9/lib/python/Products/PythonScripts/help/PythonScript.py === --- Zope/branches/2.9/lib/python/Products/PythonScripts/help/PythonScript.py 2005-11-22 15:46:15 UTC (rev 40318) +++ Zope/branches/2.9/lib/python/Products/PythonScripts/help/PythonScript.py 2005-11-22 15:49:55 UTC (rev 40319) @@ -54,7 +54,10 @@ o math - o whrandom and random + o random + + o whrandom (deprecated in Python; aliased BBB support will be +removed in Zope 2.10). o Products.PythonScripts.standard Modified: Zope/branches/2.9/lib/python/RestrictedPython/Utilities.py === --- Zope/branches/2.9/lib/python/RestrictedPython/Utilities.py 2005-11-22 15:46:15 UTC (rev 40318) +++ Zope/branches/2.9/lib/python/RestrictedPython/Utilities.py 2005-11-22 15:49:55 UTC (rev 40319) @@ -13,7 +13,7 @@ __version__='$Revision: 1.7 $'[11:-2] -import string, math, random, whrandom +import string, math, random import DocumentTemplate.sequence from DateTime.DateTime import DateTime @@ -22,7 +22,7 @@ utility_builtins['string'] = string utility_builtins['math'] = math utility_builtins['random'] = random -utility_builtins['whrandom'] = whrandom +utility_builtins['whrandom'] = random # BBB: will be removed in Zope 2.10 utility_builtins['sequence'] = DocumentTemplate.sequence utility_builtins['DateTime'] = DateTime ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/ Collector #1621, 1894: Removed support for use of long-deprecated 'whrandom' module.
Log message for revision 40320: Collector #1621, 1894: Removed support for use of long-deprecated 'whrandom' module. Changed: U Zope/trunk/doc/CHANGES.txt U Zope/trunk/lib/python/AccessControl/DTML.py U Zope/trunk/lib/python/DocumentTemplate/DT_Util.py U Zope/trunk/lib/python/Products/PythonScripts/help/PythonScript.py U Zope/trunk/lib/python/RestrictedPython/Utilities.py -=- Modified: Zope/trunk/doc/CHANGES.txt === --- Zope/trunk/doc/CHANGES.txt 2005-11-22 15:49:55 UTC (rev 40319) +++ Zope/trunk/doc/CHANGES.txt 2005-11-22 16:08:56 UTC (rev 40320) @@ -100,6 +100,9 @@ Bugs Fixed + - Collector #1621, 1894: Removed support for use of long-deprecated +'whrandom' module. + - OFS PropertySheets / webdav: Fixed dav__resourcetype. __dav_collection__ with a false value was overridden by isAnObjectManager. Modified: Zope/trunk/lib/python/AccessControl/DTML.py === --- Zope/trunk/lib/python/AccessControl/DTML.py 2005-11-22 15:49:55 UTC (rev 40319) +++ Zope/trunk/lib/python/AccessControl/DTML.py 2005-11-22 16:08:56 UTC (rev 40320) @@ -15,7 +15,7 @@ $Id$ from DocumentTemplate import DT_Util -import SecurityManagement, string, math, whrandom, random +import SecurityManagement, string, math, random import DocumentTemplate.sequence from ZopeGuards import safe_builtins @@ -27,7 +27,6 @@ DT_Util.TemplateDict.__allow_access_to_unprotected_subobjects__=1 string.__allow_access_to_unprotected_subobjects__=1 math.__allow_access_to_unprotected_subobjects__=1 -whrandom.__allow_access_to_unprotected_subobjects__=1 random.__allow_access_to_unprotected_subobjects__=1 DocumentTemplate.sequence.__allow_access_to_unprotected_subobjects__=1 Modified: Zope/trunk/lib/python/DocumentTemplate/DT_Util.py === --- Zope/trunk/lib/python/DocumentTemplate/DT_Util.py 2005-11-22 15:49:55 UTC (rev 40319) +++ Zope/trunk/lib/python/DocumentTemplate/DT_Util.py 2005-11-22 16:08:56 UTC (rev 40320) @@ -315,7 +315,7 @@ - Special security-aware versions of 'getattr' and 'hasattr', - - The Python 'string', 'math', and 'whrandom' modules, and + - The Python 'string', 'math', and 'random' modules, and - A special function, 'test', that supports if-then expressions. The 'test' function accepts any number of arguments. If the Modified: Zope/trunk/lib/python/Products/PythonScripts/help/PythonScript.py === --- Zope/trunk/lib/python/Products/PythonScripts/help/PythonScript.py 2005-11-22 15:49:55 UTC (rev 40319) +++ Zope/trunk/lib/python/Products/PythonScripts/help/PythonScript.py 2005-11-22 16:08:56 UTC (rev 40320) @@ -54,7 +54,7 @@ o math - o whrandom and random + o random o Products.PythonScripts.standard Modified: Zope/trunk/lib/python/RestrictedPython/Utilities.py === --- Zope/trunk/lib/python/RestrictedPython/Utilities.py 2005-11-22 15:49:55 UTC (rev 40319) +++ Zope/trunk/lib/python/RestrictedPython/Utilities.py 2005-11-22 16:08:56 UTC (rev 40320) @@ -13,7 +13,7 @@ __version__='$Revision: 1.7 $'[11:-2] -import string, math, random, whrandom +import string, math, random import DocumentTemplate.sequence from DateTime.DateTime import DateTime @@ -22,7 +22,6 @@ utility_builtins['string'] = string utility_builtins['math'] = math utility_builtins['random'] = random -utility_builtins['whrandom'] = whrandom utility_builtins['sequence'] = DocumentTemplate.sequence utility_builtins['DateTime'] = DateTime ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ Suppress expected DeprecationWarning output in test.
Log message for revision 40327: Suppress expected DeprecationWarning output in test. Changed: U Zope/branches/Zope-2_8-branch/doc/CHANGES.txt U Zope/branches/Zope-2_8-branch/lib/python/Products/PythonScripts/tests/testPythonScript.py -=- Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt === --- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-11-22 18:10:16 UTC (rev 40326) +++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-11-22 18:15:37 UTC (rev 40327) @@ -44,6 +44,11 @@ warnings and converted ZGadflyDA/__init__.py and ZSQLMethods/__init__.py to use registerClass instead. +Other + + - Suppressed output of deprecation warning in 'filepath' test +for PythonScripts. + Zope 2.8.4 (2005/10/26) Bugs Fixed Modified: Zope/branches/Zope-2_8-branch/lib/python/Products/PythonScripts/tests/testPythonScript.py === --- Zope/branches/Zope-2_8-branch/lib/python/Products/PythonScripts/tests/testPythonScript.py 2005-11-22 18:10:16 UTC (rev 40326) +++ Zope/branches/Zope-2_8-branch/lib/python/Products/PythonScripts/tests/testPythonScript.py 2005-11-22 18:15:37 UTC (rev 40327) @@ -25,6 +25,30 @@ if not here: here = os.getcwd() +class WarningInterceptor: + +_old_stderr = None +_our_stderr_stream = None + +def _trap_warning_output( self ): + +if self._old_stderr is not None: +return + +import sys +from StringIO import StringIO + +self._old_stderr = sys.stderr +self._our_stderr_stream = sys.stderr = StringIO() + +def _free_warning_output( self ): + +if self._old_stderr is None: +return + +import sys +sys.stderr = self._old_stderr + # Test Classes def readf(name): @@ -219,7 +243,7 @@ f = self._newPS(defn + \n + asn % name) self.assertRaises(TypeError, f) -class TestPythonScriptGlobals(PythonScriptTestBase): +class TestPythonScriptGlobals(PythonScriptTestBase, WarningInterceptor): def _exec(self, script, bound_names=None, args=None, kws=None): if args is None: args = () @@ -241,8 +265,10 @@ def test_filepath(self): # This test is meant to raise a deprecation warning. # It used to fail mysteriously instead. +self._trap_warning_output() f = self._filePS('filepath') self.assertEqual(f(), [0]) +self._free_warning_output() def test_suite(): suite = unittest.TestSuite() ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Products/PythonScripts/tests/testPythonScript.py Suppress expected DeprecationWarning output in test.
Log message for revision 40328: Suppress expected DeprecationWarning output in test. Changed: U Zope/branches/2.9/lib/python/Products/PythonScripts/tests/testPythonScript.py -=- Modified: Zope/branches/2.9/lib/python/Products/PythonScripts/tests/testPythonScript.py === --- Zope/branches/2.9/lib/python/Products/PythonScripts/tests/testPythonScript.py 2005-11-22 18:15:37 UTC (rev 40327) +++ Zope/branches/2.9/lib/python/Products/PythonScripts/tests/testPythonScript.py 2005-11-22 18:18:17 UTC (rev 40328) @@ -25,6 +25,30 @@ if not here: here = os.getcwd() +class WarningInterceptor: + +_old_stderr = None +_our_stderr_stream = None + +def _trap_warning_output( self ): + +if self._old_stderr is not None: +return + +import sys +from StringIO import StringIO + +self._old_stderr = sys.stderr +self._our_stderr_stream = sys.stderr = StringIO() + +def _free_warning_output( self ): + +if self._old_stderr is None: +return + +import sys +sys.stderr = self._old_stderr + # Test Classes def readf(name): @@ -219,7 +243,7 @@ f = self._newPS(defn + \n + asn % name) self.assertRaises(TypeError, f) -class TestPythonScriptGlobals(PythonScriptTestBase): +class TestPythonScriptGlobals(PythonScriptTestBase, WarningInterceptor): def _exec(self, script, bound_names=None, args=None, kws=None): if args is None: args = () @@ -241,8 +265,10 @@ def test_filepath(self): # This test is meant to raise a deprecation warning. # It used to fail mysteriously instead. +self._trap_warning_output() f = self._filePS('filepath') self.assertEqual(f(), [0]) +self._free_warning_output() def test_suite(): suite = unittest.TestSuite() ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py Suppress expected DeprecationWarning output in test.
Log message for revision 40329: Suppress expected DeprecationWarning output in test. Changed: U Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py -=- Modified: Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py === --- Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py 2005-11-22 18:18:17 UTC (rev 40328) +++ Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py 2005-11-22 18:18:36 UTC (rev 40329) @@ -25,6 +25,30 @@ if not here: here = os.getcwd() +class WarningInterceptor: + +_old_stderr = None +_our_stderr_stream = None + +def _trap_warning_output( self ): + +if self._old_stderr is not None: +return + +import sys +from StringIO import StringIO + +self._old_stderr = sys.stderr +self._our_stderr_stream = sys.stderr = StringIO() + +def _free_warning_output( self ): + +if self._old_stderr is None: +return + +import sys +sys.stderr = self._old_stderr + # Test Classes def readf(name): @@ -219,7 +243,7 @@ f = self._newPS(defn + \n + asn % name) self.assertRaises(TypeError, f) -class TestPythonScriptGlobals(PythonScriptTestBase): +class TestPythonScriptGlobals(PythonScriptTestBase, WarningInterceptor): def _exec(self, script, bound_names=None, args=None, kws=None): if args is None: args = () @@ -241,8 +265,10 @@ def test_filepath(self): # This test is meant to raise a deprecation warning. # It used to fail mysteriously instead. +self._trap_warning_output() f = self._filePS('filepath') self.assertEqual(f(), [0]) +self._free_warning_output() def test_suite(): suite = unittest.TestSuite() ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Products/PythonScripts/tests/testPythonScript.py Ensure we don't forget to restore sys.stderr.
Log message for revision 40337: Ensure we don't forget to restore sys.stderr. Changed: U Zope/branches/2.9/lib/python/Products/PythonScripts/tests/testPythonScript.py -=- Modified: Zope/branches/2.9/lib/python/Products/PythonScripts/tests/testPythonScript.py === --- Zope/branches/2.9/lib/python/Products/PythonScripts/tests/testPythonScript.py 2005-11-23 02:18:03 UTC (rev 40336) +++ Zope/branches/2.9/lib/python/Products/PythonScripts/tests/testPythonScript.py 2005-11-23 02:18:27 UTC (rev 40337) @@ -244,6 +244,14 @@ self.assertRaises(TypeError, f) class TestPythonScriptGlobals(PythonScriptTestBase, WarningInterceptor): + +def setUp(self): +PythonScriptTestBase.setUp(self) + +def tearDown(self): +self._free_warning_output() +PythonScriptTestBase.tearDown(self) + def _exec(self, script, bound_names=None, args=None, kws=None): if args is None: args = () ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py Ensure we don't forget to restore sys.stderr.
Log message for revision 40338: Ensure we don't forget to restore sys.stderr. Changed: U Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py -=- Modified: Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py === --- Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py 2005-11-23 02:18:27 UTC (rev 40337) +++ Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py 2005-11-23 02:18:55 UTC (rev 40338) @@ -244,6 +244,14 @@ self.assertRaises(TypeError, f) class TestPythonScriptGlobals(PythonScriptTestBase, WarningInterceptor): + +def setUp(self): +PythonScriptTestBase.setUp(self) + +def tearDown(self): +self._free_warning_output() +PythonScriptTestBase.tearDown(self) + def _exec(self, script, bound_names=None, args=None, kws=None): if args is None: args = () ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
Re: [Zope-dev] Re: UI improvements
Alexander Limi schrieb: On Fri, 18 Nov 2005 06:56:32 -0800, Andreas Jung [EMAIL PROTECTED] wrote: In general such changes should be made on the HEAD (for next 2.10 release). OK. I was aiming for a quick sprint to get some small changes into 2.9 before release (ie. no actual code changes, just moving text and eliminating HappyTalk™ to make the interface usage clearer). I got a small UI patch to have product icons in the add-dropdown which turns out to reduce the mistakes on klicking on the wrong product to add to a minimum. Maybe you like to include it too? http://www.zope.org/Members/tino/PatchObjectManager-1.0/view It could even get some improvements - grouping factories by product could even help if the list is very long. Just some thoughts. ++Tino ___ 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: UI improvements
--On 22. November 2005 09:11:13 +0100 Tino Wildenhain [EMAIL PROTECTED] wrote: Alexander Limi schrieb: On Fri, 18 Nov 2005 06:56:32 -0800, Andreas Jung [EMAIL PROTECTED] wrote: In general such changes should be made on the HEAD (for next 2.10 release). OK. I was aiming for a quick sprint to get some small changes into 2.9 before release (ie. no actual code changes, just moving text and eliminating HappyTalk™ to make the interface usage clearer). I got a small UI patch to have product icons in the add-dropdown which turns out to reduce the mistakes on klicking on the wrong product to add to a minimum. Maybe you like to include it too? http://www.zope.org/Members/tino/PatchObjectManager-1.0/view It could even get some improvements - grouping factories by product could even help if the list is very long. Since 2.9 is delayed until Zope 3.2 is ready for beta 1 you could commit it to the HEAD and 2.9 branch. -aj pgpg1oocp3SKZ.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 )
Re: [Zope-dev] Re: UI improvements
Andreas Jung schrieb: --On 22. November 2005 09:11:13 +0100 Tino Wildenhain [EMAIL PROTECTED] wrote: Alexander Limi schrieb: On Fri, 18 Nov 2005 06:56:32 -0800, Andreas Jung [EMAIL PROTECTED] wrote: In general such changes should be made on the HEAD (for next 2.10 release). OK. I was aiming for a quick sprint to get some small changes into 2.9 before release (ie. no actual code changes, just moving text and eliminating HappyTalk™ to make the interface usage clearer). I got a small UI patch to have product icons in the add-dropdown which turns out to reduce the mistakes on klicking on the wrong product to add to a minimum. Maybe you like to include it too? http://www.zope.org/Members/tino/PatchObjectManager-1.0/view It could even get some improvements - grouping factories by product could even help if the list is very long. Since 2.9 is delayed until Zope 3.2 is ready for beta 1 you could commit it to the HEAD and 2.9 branch. Fine. Is this yet part of the discussion yes, we want that or well, if you cant hold it...? ;) Some +1 on the matters could motivate :-) Here is the list w/ improvements ante portas: 1) Icons for add-dropdown list 2) History + History compare for all objects and more useable diff 3) warning when commiting stale edit forms in ZPT, python script (expect hight discussion 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 )
[Zope-dev] Re: Removing whrandom in Zope 2.9 (was Re: New testrunner on the Zope 2 trunk.)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- FWIW: Alot. :) $ pwd /home/tseaver/projects/Zope-CVS/Zope-2_8-branch $ find . -name *.py | grep -v build-base | xargs grep -l whrandom ./lib/python/AccessControl/DTML.py ./lib/python/Products/PythonScripts/help/PythonScript.py ./lib/python/Products/ZCatalog/regressiontests/regressionCatalog.py ./lib/python/Products/ZCatalog/regressiontests/loadmail.py ./lib/python/RestrictedPython/Utilities.py ./lib/python/DocumentTemplate/DT_Util.py ./lib/python/zope/security/examples/sandbox.py ./lib/python/zope/security/examples/sandbox_security.py Sigh. ... Hmm, I see that RestrictedPython/Utilities.py on the Z3 trunk aliases 'random' as 'whrandom' -- could we use that strategy for 2.8 etc.? Yes. random has the same documented functions and signatures as whrandon. We could remove them for 2.9, I guess, and just make people fix their applications. I suggest we make aliases and generate deprecation warnings if whrandom is used. (The later may be tricky, I realize.) Maybe for now, just make aliases and move on. :) Jim I have aliased 'random' to 'whrandom' in AccessControl.DTML and RestrictedPython.Utilities on the 2.8 branch and the 2.9 branch, and added comments noting BBB to be removed in Zope 2.10. I removed all mention of 'whrandom' the trunk. 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 iD8DBQFDg02l+gerLs4ltQ4RAka7AJ9KMqjSPLf7z7PmMVXYJtxjRcfhhwCgk0/G rpQ/pfqd/bI+6Bae7GFKX9M= =PfQh -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 )
[Zope-dev] Re: Running all unittests in $INSTANCE_HOME
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: On Fri, 2005-11-18 at 08:43 -0500, Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Withers wrote: Paul Winkler wrote: On Thu, Nov 17, 2005 at 02:33:10PM -0200, Sidnei da Silva wrote: I might have asked this before, but can't seem to find it. I'm looking for a way to run all tests in $INSTANCE_HOME using the test.py script, but can't seem to get the majik combination of parameters together. Would anyone hint me? ./bin/zopectl test is supposed to do the job. But in practice, so many third-party product tests either have broken dependencies or pollute the test environment somehow that something always breaks. bin/zopectl test Products/MyProduct ...has worked fine for me for many months now... Hmm, that should be a dotted name, rather than a path: $ bin/zopectl test Products.MyProduct Because the first argument is interpreted as a regex, using search, you can leave the 'Product.' bit off, as well as supplying more complicated specifications, e.g.: $ bin/zopectl test OneProduct|AnotherProduct Run with --help to get docs on the command-line syntax: $ bin/zopectl test --help That pattern breaks on the Zope trunk, where you have to pass the module pattern as an option rather than an argument: $ bin/zopectl test -m MyProduct You can still pass a module pattern and a test pattern as positional arguments. This is for backward compatibility. It's broken, then: $ ../bin/python2.4 test.py -v -m PythonScripts Running tests at level 1 Running unit tests: Running: . Ran 29 tests with 0 failures and 0 errors in 0.426 seconds. versus: $ ../bin/python2.4 test.py -v PythonScripts Running tests at level 1 Running unit tests: Running: .. .. (snip) . Ran 4175 tests with 0 failures and 0 errors in 147.654 seconds. While we're at it, what is the rationale for the 50 column indented output (in dots mode) for the new testrunner, versus the 80 column flush output which is standard in Python / Java CLI test runners? 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 iD8DBQFDg18u+gerLs4ltQ4RAhrGAJ0QZ+oIRnUaO7TPUF8JYuLfQc4jHQCgk2lY KaZMTRVAEPQamq5rHwrImLE= =ygIU -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 )
[Zope-dev] Memory Leak, and Changing Severity of a Bug
I'd like to upgrade bug 1950 to critical. Is there an easy way to do this? ___ Daniel PozmanterSiteworx, Inc. "Festina Lente" - Gaius Julius ___ 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] zope.testrecorder
We don't have the collective time right now to market this, but it's very cool so we thought someone might get some use out of it. Brian Lloyd has developed zope.testrecorder, a cross-browser (IE, Firefox, Safari) JavaScript app that records browser events (clicking, entering text, etc.) and test assertions (this text box should contain this text, this checkbox should be unchecked, etc.) and renders the captured events as either an HTML Selenium test or a doctest using zope.testbrowser. It can be installed as a product into Zope 2 or as a Python package in Zope 3. The rendering framework is pluggable and it's pretty easy to add new rendering options for other testing systems (twill, etc.). The testrecorder is currently in beta form, but is very handy, so if anyone wants to use/market/improve/add tests for it, go ahead. :) Get it via Subversion at svn://svn.zope.org/repos/main/zope.testrecorder/trunk -- Benji York Senior Software Engineer Zope Corporation ___ 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] How bad _are_ ConflictErrors
Chris Withers wrote at 2005-11-21 16:33 +: ... here's a line from one of our event logs: 2005-11-17T08:00:27 INFO(0) ZODB conflict error at /some_uri (347 conflicts since startup at 2005-11-08T17:56:20) What is this telling me? It is incredibly stupid. The message above only tells you, that (at the given time) a request for /some_uri resulted in a ConflictError and that since startup (at the given time) 347 conflicts occured. Unfortunately, it does not tell you * what object caused the conflict * whether it is a read or a write conflict (read conflicts are very rare since MVCC introduction, but they may still happen) * for write conflicts: what versions of the object did particate A long time ago, I posted an extension making this additional information available (it is all present in the exception instance. Zope is just too stupid to read (and log) it). Did the user actually see a ConflictError page? Usually not. Or was this error successfully resolved? It may (or may not) later be resolved. This is still not clear when the message is generated. What object did this ConflictError occur on and/or how can I modify my our Zope instances to find out where the conflict was occurring? See above -- search the archive for the extension... Now, when should the number of ConflictErrors logged in this way start to become worrying? When you start to see lots on them (per time unit). I analysed the logs from our cluster and we're getting about 450 conflict errors in our busiest hours when the cluster of 8 ZEO clients is taking about 11,000 hits in that hour. Is this 'bad'? I would not be happy: it is about 5 %. This gives quite some chance that your customers see failures caused by the conflicts (when 3 repetitions are not enough). If so, where should I start to make things better? You find out which objects cause the conflicts. You analyse what you can do to reduce concurrent writes to these objects (split into separate persistent subobjects) or whether you can provide conflict resolution. -- Dieter ___ 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: How bad _are_ ConflictErrors
Florent Guillaume wrote at 2005-11-22 00:13 +0100: ... I'm actually not sure what's logged when a Conflict Error makes it back to the users, offhand I don't see anything in my logs. Can someone confirm or infirm that fact? If nothing is logged, I'll add something at level ERROR. I fear nothing is logged. If you are at it you should make the log entry for ConflictError much more informative by logging the str of the ConflictError instance. It will tell: the conflicting object, the type of the conflict and the participating versions. BTW does someone have a handy script to provoke conflict errors on a naked Zope? They are most easily reproduced with local transactions: conn1 = db.open(); conn1.setLocalTransaction(); r1 = conn1.root() conn2 = db.open(); conn2.setLocalTransaction(); r2 = conn2.root() r1['a'] = 1; r2['a'] = 2 conn1.getTransaction().commit() conn2.getTransaction().commit() Note that setLocalTransaction is deprecated in ZODB 3.4. You get similar effects with special TransactionManagers (look at how setLocalTransaction is implemented). If you only want to check your logging extension, you can just raise a ConflictError. -- Dieter ___ 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: Memory Leak, and Changing Severity of a Bug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dan Pozmanter wrote: I'd like to upgrade bug 1950 to critical. Is there an easy way to do this? I just followed up to the bug report: we need a test case, written in Python, which demonstrates the leak. The usual course when trying to isolate what you think is a leak is to run with a debug build of Python, and then use its API for checking uncollectable objects, as described in Sam Rushing's how-to: http://www.nightmare.com/medusa/memory-leaks.html 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 iD8DBQFDg347+gerLs4ltQ4RAuf/AKCOdLgQykq4QYbc8eTW0XdDXqR05wCcDtKL Q5EXQuThiroOFX/Ilm94ywE= =gkQv -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 )
[Zope-dev] Re: Removing whrandom in Zope 2.9 (was Re: New testrunner on the Zope 2 trunk.)
Cool, thanks! Jim Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- FWIW: Alot. :) $ pwd /home/tseaver/projects/Zope-CVS/Zope-2_8-branch $ find . -name *.py | grep -v build-base | xargs grep -l whrandom ./lib/python/AccessControl/DTML.py ./lib/python/Products/PythonScripts/help/PythonScript.py ./lib/python/Products/ZCatalog/regressiontests/regressionCatalog.py ./lib/python/Products/ZCatalog/regressiontests/loadmail.py ./lib/python/RestrictedPython/Utilities.py ./lib/python/DocumentTemplate/DT_Util.py ./lib/python/zope/security/examples/sandbox.py ./lib/python/zope/security/examples/sandbox_security.py Sigh. ... Hmm, I see that RestrictedPython/Utilities.py on the Z3 trunk aliases 'random' as 'whrandom' -- could we use that strategy for 2.8 etc.? Yes. random has the same documented functions and signatures as whrandon. We could remove them for 2.9, I guess, and just make people fix their applications. I suggest we make aliases and generate deprecation warnings if whrandom is used. (The later may be tricky, I realize.) Maybe for now, just make aliases and move on. :) Jim I have aliased 'random' to 'whrandom' in AccessControl.DTML and RestrictedPython.Utilities on the 2.8 branch and the 2.9 branch, and added comments noting BBB to be removed in Zope 2.10. I removed all mention of 'whrandom' the trunk. 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 iD8DBQFDg02l+gerLs4ltQ4RAka7AJ9KMqjSPLf7z7PmMVXYJtxjRcfhhwCgk0/G rpQ/pfqd/bI+6Bae7GFKX9M= =PfQh -END PGP SIGNATURE- -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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: Memory Leak, and Changing Severity of a Bug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dan Pozmanter wrote: Yes, I saw the follow up. So is there no way to change the severity of a bug? It could be changed, but you need to persuade us that it is a showstopper first. Labeling the bug critical is a claim that we have to fix it before making another release, which isn't reasonable without a reproducible test case. Back to the bug. ''' I was poking around in _Acquisition.c, and noticed my memory usage spiked. Returning to the vanilla code (2.8.2-final), I noticed the same spike (just less pronounced). (If you refresh the page a few gazillion times this pops up). ''' In other words, this is happening in utterly unmodified c code. Thanks for the link, I'll do some poking around. Is there a standard way for freeing the memory for the result of a Wrapper_findattr call from within _Acquistion.c? See http://docs.python.org/api/countingRefs.html 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 iD8DBQFDg5O++gerLs4ltQ4RArzfAKCzwxMi1sA3iHfT3ksQOPqYPv8wZgCfZ08T 2L9r5Ju8cnw51VZIEpgNYXQ= =z2el -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] RE: Memory Leak Question
Dan Pozmanter wrote: Sure thing: I was mucking around in _Acquisition.c with getattr, findattr, etc, and I noticed checked to see if my code was leaky. It was! I then checked just vanilla code, and found the same leak (only much much smaller). So here is what I did to make things more visible: In Wrapper_getattro, I simply added a while loop, and another call to Wrapper_findattr before the return statement return Wrapper_findattr(self, oname, NULL, NULL, NULL, 1, 1, 0, 0);. Loop it 1000 times for some fireworks, 5 times for a more modest display. Looping other calls (such as Wrapper_acquire before return Wrapper_acquire(self, oname, filter, extra, orig, explicit, containment); in Wrapper_findattr) does not produce a similar leak. So. To reproduce: Edit _Acquisition.c Function Wrapper_getattro add int i = 0; at the top. then, if self-obj ... and all that, add: while (i xyz) { Wrapper_findattr(self, oname, NULL, NULL, NULL, 1, 1, 0, 0); i++; } Wrapper_findattr (like, for example, PyObject_GetAttr) returns a *new* reference to the result of the attribute access. So this would, of course, cause a leak. If you have code that is calling Wrapper_findattr and not taking care of the new reference, then it is not surprizing that you have a leak. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py Suppress expected DeprecationWarning output in test.
Isn't a try: ... finally: ... needed here? Florent Tres Seaver wrote: Log message for revision 40329: Suppress expected DeprecationWarning output in test. Changed: U Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py -=- Modified: Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py === --- Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py 2005-11-22 18:18:17 UTC (rev 40328) +++ Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py 2005-11-22 18:18:36 UTC (rev 40329) @@ -25,6 +25,30 @@ if not here: here = os.getcwd() +class WarningInterceptor: + +_old_stderr = None +_our_stderr_stream = None + +def _trap_warning_output( self ): + +if self._old_stderr is not None: +return + +import sys +from StringIO import StringIO + +self._old_stderr = sys.stderr +self._our_stderr_stream = sys.stderr = StringIO() + +def _free_warning_output( self ): + +if self._old_stderr is None: +return + +import sys +sys.stderr = self._old_stderr + # Test Classes def readf(name): @@ -219,7 +243,7 @@ f = self._newPS(defn + \n + asn % name) self.assertRaises(TypeError, f) -class TestPythonScriptGlobals(PythonScriptTestBase): +class TestPythonScriptGlobals(PythonScriptTestBase, WarningInterceptor): def _exec(self, script, bound_names=None, args=None, kws=None): if args is None: args = () @@ -241,8 +265,10 @@ def test_filepath(self): # This test is meant to raise a deprecation warning. # It used to fail mysteriously instead. +self._trap_warning_output() f = self._filePS('filepath') self.assertEqual(f(), [0]) +self._free_warning_output() def test_suite(): suite = unittest.TestSuite() ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins -- Florent Guillaume, Nuxeo (Paris, France) 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 )
[Zope-dev] Re: SVN: Zope/trunk/lib/python/Products/PythonScripts/tests/testPythonScript.py Suppress expected DeprecationWarning output in test.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Florent Guillaume wrote: Isn't a try: ... finally: ... needed here? Yup. Or else call '_free_warning_output' call in 'tearDown' (which I jsut checked in). Thanks for the catch! 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 iD8DBQFDg9G6+gerLs4ltQ4RAjEVAJ9LzGnjbzl8/J1INaA0oyu8LskSqACg3Iui 5RDdLqjmJ8NMJ1zzs/Ug77Q= =DVyQ -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 )
[Zope-dev] Re: Re: UI improvements
On Mon, 21 Nov 2005 06:47:34 -0800, Chris Withers [EMAIL PROTECTED] wrote: Jens Vagelpohl wrote: IMHO if this is just UI changes that improve usability it should be OK to flout the rules a bit. The rules are there to ensure code quality and stability in a release branch - I doubt small UI changes endanger those. Beware the slippery slope to hell, paved with good intentions ;-) I can assure you that I have no good intentions whatsoever, just a desire to see the I clicked the Clear Catalog button, now what do I do questions on plone-users decrease. Pure annoyance-driven development. ;) -- _ 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-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-DB] insert failing without raising exception: postgresql, psycopg
On 2005-11-22 at 12:27:42 [+0100], [EMAIL PROTECTED] wrote: Though the insert is failing, a sequence column in the target table is apparently being incremented by the failing insert. (I deduce this from the fact that subsequent Z SQL test inserts show sequence gap of 12 after each failed insert attempt, while no gap occurs when I call the Z SQL method repeatedly via Zope's test tab.) I will appreciate any suggestions as to how I might troubleshoot this. You should probably compile psycopg to give debug information and I would suggest updating to the most recent build in the 1 series. In addition you might want to try using our mxODBCZopeDA to see if the error is with the DA/driver or in Zope itself. Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source Python/Zope Consulting and Support ...http://www.egenix.com/ mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/ 2005-10-17: Released mxODBC.Zope.DA 1.0.9http://zope.egenix.com/ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db