[Zope-Checkins] CVS: Packages/ZODB - referencesf.py:1.6.94.3
Update of /cvs-repository/Packages/ZODB In directory cvs.zope.org:/tmp/cvs-serv13892/ZODB Modified Files: Tag: Zope-2_7-branch referencesf.py Log Message: referencesf(): Use %r instead of %s format in the error message, else the pickle shown is full of unprintable characters. === Packages/ZODB/referencesf.py 1.6.94.2 = 1.6.94.3 === --- Packages/ZODB/referencesf.py:1.6.94.2 Thu Oct 2 19:32:50 2003 +++ Packages/ZODB/referencesf.pyThu Jun 2 17:24:43 2005 @@ -35,7 +35,7 @@ u.persistent_load = [] u.noload() if len(p) f.tell(): -raise ValueError, 'Error unpickling, %s' % p +raise ValueError, 'Error unpickling %r' % p # References may have class info, so we need to # check for wrapped references. ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] CVS: Cruft/ExtensionClass/src - Acquisition.c:1.61.4.3
Update of /cvs-repository/Cruft/ExtensionClass/src In directory cvs.zope.org:/tmp/cvs-serv13461/lib/Components/ExtensionClass/src Modified Files: Tag: Zope-2_7-branch Acquisition.c Log Message: - Collector #1799: Avoid lying about parent's refcount when calling back into Python code. === Cruft/ExtensionClass/src/Acquisition.c 1.61.4.2 = 1.61.4.3 === --- Cruft/ExtensionClass/src/Acquisition.c:1.61.4.2 Sat Apr 9 03:13:19 2005 +++ Cruft/ExtensionClass/src/Acquisition.c Thu Jun 2 23:27:25 2005 @@ -145,9 +145,9 @@ UNLESS(r=PyObject_GetAttr(inst, py__of__)) return NULL; UNLESS(t=PyTuple_New(1)) goto err; + Py_INCREF(parent); PyTuple_SET_ITEM(t,0,parent); ASSIGN(r,PyObject_CallObject(r,t)); - PyTuple_SET_ITEM(t,0,NULL); Py_DECREF(t); if (r ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] CVS: Zope/doc - CHANGES.txt:1.625.2.335
Update of /cvs-repository/Zope/doc In directory cvs.zope.org:/tmp/cvs-serv13461/doc Modified Files: Tag: Zope-2_7-branch CHANGES.txt Log Message: - Collector #1799: Avoid lying about parent's refcount when calling back into Python code. === Zope/doc/CHANGES.txt 1.625.2.334 = 1.625.2.335 === --- Zope/doc/CHANGES.txt:1.625.2.334Fri May 27 09:03:49 2005 +++ Zope/doc/CHANGES.txtThu Jun 2 23:27:25 2005 @@ -14,6 +14,9 @@ Bugs fixed + - Collector #1799: Avoid lying about parent's refcount when +calling back into Python code. + - Collector #889: made 'and' operator for KeywordIndexes actually restrict results as expected (thanks to 'aroda' for the patch!). ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-dev] CorruptedDataError sniff !
Hi all, Houston, we've got big a problem ! Here is the traceback in ZEO_EVENTS.log: -- 2005-06-02T11:45:21 INFO(0) zrpc-conn:193.49.250.194:37684 zeoLoad() raised exception: 968647571 Traceback (innermost last): File /data/ZeoCVS/lib/python/ZEO/zrpc/connection.py, line 234, in handle_request File /data/ZeoCVS/lib/python/ZEO/StorageServer.py, line 337, in zeoLoad File /data/ZeoCVS/lib/python/ZODB/FileStorage.py, line 694, in modifiedInVersion (Object: /data/ZeoCVS/var/Data.fs) CorruptedDataError: 968647571 And I can't pack the zodb, when I pack I've got this traceback : -- 2005-06-02T08:48:17 ERROR(200) zrpc:1193 Error raised in delayed method Traceback (innermost last): File /data/ZeoCVS/lib/python/ZEO/StorageServer.py, line 865, in run File /data/ZeoCVS/lib/python/ZEO/StorageServer.py, line 402, in pack_impl File /data/ZeoCVS/lib/python/ZODB/FileStorage.py, line 1503, in pack (Object: /data/ZeoCVS/var/Data.fs) File /data/ZeoCVS/lib/python/ZODB/fspack.py, line 680, in pack File /data/ZeoCVS/lib/python/ZODB/fspack.py, line 464, in findReachable File /data/ZeoCVS/lib/python/ZODB/fspack.py, line 478, in buildPackIndex File /data/ZeoCVS/lib/python/ZODB/fspack.py, line 180, in checkTxn File /data/ZeoCVS/lib/python/ZODB/fspack.py, line 170, in fail CorruptedError: /data/ZeoCVS/var/Data.fs:968633329:invalid transaction status: 'g' I run Zope 2.6.2 , ZEO 2 and ZODB 3.1 I have tried to do a fsrecover, it removes a transaction. Then when I tried to lunch a pack, I've got a very strange error about unpickling : Error unpickling, ((UBTrees._IIBTreeqUIIBucketqtqNt.((JÇü KJQKJyWKJ}WKJ06KJKJ®KJÃøKJKKJKKJKKJ KKJ¡KKJ¢KKJ¦KKJ8KJÜS KJê!KJGF*KJ%D.KJ .KJ.KJ.KJ;w/KJw/KJ?w/KJ~G0KJο1KJÁ3KJ'^7KJ;KJ¢;KJwûKJzûKJ{ûKJÄKJ#IGKJPLGKJ|IKJJKKJ¶ÊMKJ ]KJ ]KJ ]KJ ]KJ ]KJ ]KJ ]KJ ]KJ¡ ]KJrdKJæãdKJèãdKJ¿gKJ¿gKJ]¸yKJÆozKJ¸|KJ¹|KJÁ|KJ |KJ}KJ}KJ}KJ}KJCKJIÏKJJÏKJd¹ KJf¹ KJ#[KJ÷KJM»KJNÖ´ KJ×´ KJÚ´ KJÛ´ KJC) KJ KJ©Ø¦ KJ¢Ò KJòê KJÀDô KJ×Dô KJû KJ$R KJIr| KJðµ KJÛ$û KJ}KJM»KJî²KJò²KJó²KJô²KJ×ØKJ5´9KJ´9KJ¯¾ãKJ/hûK I try to copyTransaction in a new Storage but it failed too. This is a production site. My last backup which is not corrupted date of Sunday morning ! Please Help me ___ 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] application server standards
Hi All, Im busy conducting an analysis on some python web appplication servers. I have a few questions with regard to Zope: 1 How scalable is Zope ( how)? 2 With regard to web application standards how does it comply: - HTTP protocol support - server-side code execution - client-side code execution - easy integration of javascript for client side checking - any database adapters provided by the framework - communication standards integration - management tools and remote controls 3 How well does Zope rate in the security department? Thanks _ For super low premiums, click here http://www.dialdirect.co.za/quote ___ 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] CorruptedDataError sniff !
[Eric Brun] | Houston, we've got big a problem ! Here is the traceback in ZEO_EVENTS.log: ... CorruptedDataError: 968647571 And I can't pack the zodb, ... Packing is the last thing you should be trying when you have corruption. There's no mechanical, safe way to recover. Please read this: http://zope.org/Wikis/ZODB/FileStorageBackup and start by using fstest, then fsrefs, as described there. I run Zope 2.6.2 , ZEO 2 and ZODB 3.1 Just noting that it's harder to get help with old releases. I have tried to do a fsrecover, it removes a transaction. Then when I tried to lunch a pack, Packing isn't an error recovery procedure. I've got a very strange error about unpickling : That suggests object pickles are corrupt too; fstest can't discover that, and fsrecover can't repair that. fsrefs _may_ (or may not) be provoked into complaining, or even crashing, by it. Error unpickling, ((UBTrees._IIBTreeqU... [lots of gibberish] ... I try to copyTransaction in a new Storage but it failed too. This is a surprise wink? Seriously, garbage in, garbage out applies here. The garbage has to be repaired first. This is a production site. My last backup which is not corrupted date of Sunday morning ! Since fsrecover didn't work for you, you need to learn more about the nature of the damage. fstest, fsrefs, and fsdump are the basic tools to start figuring that out. ___ 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: Re: [Zope-dev] CorruptedDataError sniff !
Packing is the last thing you should be trying when you have corruption. In fact I discover the corruption during the pack. There's no mechanical, safe way to recover. Please read this: http://zope.org/Wikis/ZODB/FileStorageBackup This is a great document. I think the origin of the corruption is my RAID controler so I have ask to the server owner to switch for a new server. and start by using fstest, then fsrefs, as described there. I run Zope 2.6.2 , ZEO 2 and ZODB 3.1 Just noting that it's harder to get help with old releases. I have mount my zodb on a Zope2.7.6 and I'm working on this release to solve my problem. fstest say all is ok. fsrefs say that : oid 0x37d8e5 BTrees._IIBTree.IIBTree last updated: 2005-05-28 15:48:11.159195, tid=0x35D95942F9CD111L refers to invalid object: oid 0x5d4787 missing: 'BTrees._IIBTree.IIBucket' oid 0x37d8ec BTrees._IOBTree.IOBucket last updated: 2005-05-07 00:56:12.524043, tid=0x35D1BF8356F9844L refers to invalid object: oid 0x39c22b missing: 'BTrees._IIBTree.IIBTree' .. etc ___ 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] [Proposal] Drop Mount.py from ZODB 3.5
http://www.zope.org/Collectors/Zope/1800 describes some of the code problems with Zope's current way of mounting databases. ZODB 3.4 (still) has a Mount.py module, unused and untested by ZODB. Jim and I were both surprised today to discover that Zope (2.8) still imports it, so we can't drop it for ZODB 3.4 (Zope 2.8, and the ZODB 3.4 it uses, are both in beta). We'd like to continue getting non-ZODB code out of the ZODB project, so would like to drop Mount.py from ZODB 3.5. Are any of zodb-dev's standalone ZODB users making use of Mount.py? I would be surprised by that too, since Mount.py relies on other code (like Acquisition) that's already been removed from the ZODB 3.3 and 3.4 lines. I've been surprised before, though ... ___ 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] WebDav or Calendar.
Am Mittwoch, den 01.06.2005, 22:15 -0300 schrieb Fernando Lujan: Hi, I need a Calendar or WebDav product wich runs with Zope, allow me to share my calendar with others users using mozilla Calendar, Sunbird. evolution, outlook and so on...Something like OpenGroupware. Do someone have a good suggestion? :) http://www.mxm.dk/products/public/mxm_ical_tool/ The ical module from mxm can be used by own code too, so you dont need the above if you use plain zope. The glue code, however must then be provided by you. In this case: http://www.mxm.dk/products/public/ical/ ___ 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] WebDav or Calendar.
On 6/2/05, Fernando Lujan [EMAIL PROTECTED] wrote: I need a Calendar or WebDav product wich runs with Zope, allow me to share my calendar with others users using mozilla Calendar, Sunbird. evolution, outlook and so on...Something like OpenGroupware. Do someone have a good suggestion? :) Well, yes, the new calendar project from Nuxeo: http://www.cps-project.org/sections/projects/calendar_server This is a Five based calendar, with WebDAV and iCal support. Still in beta, with version 1.0 expected soon, so any testing is appriciated. ;) We would like to see WebCAL support (a better API that basically treats each event separately, instead of in a large file like WebDAV+ iCal does) and we would like integration with other calendar servers, like Kolab and OpenGroupware. The system is written so that it should be possible to write an OpenGroupware storage quite easily, and we would very much like to see this architecture come to full fruitition. -- 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 )
[Zope] MySQL timestamp issue
Yellow, Could anyone explain me why this works in Zope 2.7.0 final and doesn't work in Zope 2.7.6 final and/or 2.8.0b1 ?? dtml-var timestampvar fmt=%Y-%m-%d also when I try this: dtml-var _.DateTime(timestampvar) fmt=%Y-%m-%d Zope hangs!!! ps: timestampvar is a timestamp var comming from MySQL 4.0.24 tia -- Hugo Ramos - [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] [ANN] TextIndexNG 3.0.2 released
F I am pleased to announce the release of TextIndexNG V 3.0.2. TextIndexNG V 3 is a complete new implementation based on Zope 3 technologies and can be used both in Zope 2.8 or 2.7 (with Five) or in Zope 3. What's new? - multi-field indexing and query support - multi-lingual support - configurable converters (through ZCML) - new indexing API (allowing you to hook your custom content types with TextIndexNG through Zope 3 adapters). Changes since V 3.0.2: - multi-field query support added: the query parser now accepts queries where you can search within multiple fields using a single query e.g. 'title::phrase(The Zope Book) and author::or(michel amos)' which searches for all documents with the exact title 'The Zope Book' and where the author field contains 'michel' or 'amos'. See doc/README.txt for details on the query syntax. - new extension module 'txngstemmer' providing language dependant stemmer support based on the Snowball stemmer library. This is a reimplementation of the older PyStemmer extension module based on the new Snowball reimplementation allowing a much cleaner and easier integration. Outstanding compilation problems and problems with unicode should be finally resolved. Stemmer support will be added to TextIndexNG in a later version. Requirements: - Zope 2.8 or Zope 2.7 (+ Five) or Zope 3 (Zope 3 has nothing like catalogs yet) TextIndexNG V3 will *not* run with bare Zope 2.7 installations without Five (and this will not be changed in the future). Download: http://sf.net/projects/textindexng For installation and documentation issues refer to doc/README.txt from the archive. It's basically the same procedure as with former versions except you *need* to recompile the extension modules. Windows binaries of the required extension modules are currently not available (any volunteers?). TextIndexNG V 3 is published under the GPL. Andreas Jung --- - Andreas JungZOPYX Software Development and Consulting - - E-mail: [EMAIL PROTECTED] Web: www.zopyx.com - --- pgpR3ji8nk3Ln.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] Creating a Product
hi, i have add a new directory in my "Products" directory.. however, when i try to add the __init__.py file , it giver me an error.. Error Type: BadRequestError Value: The id "__init__" is invalid because it begins with an underscore. how do i add this file? regards, varun Yahoo! Mail Stay connected, organized, and protected. Take the tour___ 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] Creating a Product
On 6/2/05, Varun Parange [EMAIL PROTECTED] wrote: i have add a new directory in my Products directory.. however, when i try to add the __init__.py file , it giver me an error.. Error Type: BadRequest Error Value: The id __init__ is invalid because it begins with an underscore. how do i add this file? The Products folder in the control panel is not a file system directory. The Products directory refers to the directory Products that is created on the file system, where you created your Zope instance when you installed Zope. -- 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 )
[Zope] importing encode_base64
hi, i am having problems importing encode_base64 i have created a product in which i have specified: ''' from AccessControl import allow_module, allow_class, allow_typefrom AccessControl import ModuleSecurityInfo, ClassSecurityInfo from email.Encoders import encode_base64 allow_class(encode_base64) '' however when i try using it: from Products.EmailTools import MIMEText,MIMEBase,MIMEMultipart,Header,encode_base64 i get an error saying: Error Type: ImportErrorError Value: cannot import name encode_base64 All other modules are imported except this one... how do i import it? regards, varun Discover Yahoo! Have fun online with music videos, cool games, IM & more. Check it out!___ 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] importing encode_base64
--On 2. Juni 2005 10:34:20 -0700 Varun Parange [EMAIL PROTECTED] wrote: hi, i am having problems importing encode_base64 i have created a product in which i have specified: ''' from AccessControl import allow_module, allow_class, allow_type from AccessControl import ModuleSecurityInfo, ClassSecurityInfo from email.Encoders import encode_base64 allow_class(encode_base64) '' however when i try using it: from Products.EmailTools import MIMEText,MIMEBase,MIMEMultipart,Header,encode_base64 i get an error saying: Error Type: ImportError Error Value: cannot import name encode_base64 ..the standard answer: allow_module is not a solution for all and everything. Use external methods or write Zope Product. -aj pgp9M20TVgvzM.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] Property id clashes with object id?
I just observed something which I really wouldn't have expected. If I set a property on an object, via a PropertySheet, I then cannot add an object of the same id at the same level (and vice-versa). Say I have a folder, to which I add a property named 'draft'. Then I try to add any object (Page Template, whatever) with an id of 'draft' inside the folder. This fails with OFS.ObjectManager.checkValidId complaining that the id is already in use. Is this how it's supposed to work? This is on Zope 2.7.3-0, and I just verified it also is the case on Zope 2.7.6 final. Thanks in advance, Rob __ Discover Yahoo! Get on-the-go sports scores, stock quotes, news and more. Check it out! http://discover.yahoo.com/mobile.html ___ 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] Property id clashes with object id?
On Thu, Jun 02, 2005 at 12:05:00PM -0700, Rob Boyd wrote: I just observed something which I really wouldn't have expected. If I set a property on an object, via a PropertySheet, I then cannot add an object of the same id at the same level (and vice-versa). Yes. PropertyManager just stores properties as attributes. So they're in the same namespace as ObjectManager sub-objects. Arguably that's wrong, but this is the first time I've heard of anybody having a problem with it :-) -- Paul Winkler http://www.slinkp.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] Silly question
The DWIM of not disallowing traversal of underscore names is useful (because it makes it easy to conventionally mark attrs as private) but it can definitely be a drag if you really do want to publish something that begins with an underscore; this happens a lot when you need to deal with allowing uploads of arbitrary filenames. It might be useful to add something like you propose, except I might take exception to the name isTraversable (everything is traversable, really); maybe just set a magic attr on the object like __allow_underscore_traversal__. However, adding such a feature would need to be done carefully. Much usage of the Zope security machinery utterly depends on not being able to traverse underscore names. - C On Thu, 2005-06-02 at 15:59 -0400, Dan Pozmanter wrote: Wouldn't it be cool if instead of checking explicitly for a leading '_' during traversal, you ran a method isTraversable (On SimpleItem for instance), which by default just checks for a leading '_', but could be overridden in a particular class? Dan ___ 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] Silly question
The name could change easily enough. How about __bobo_always_allow__ Which can either be: None A List of traversable items A method that takes the path, and returns whether or not it is traversable. So for a path p: if p[0] == '_': if p_object.__bobo_always_allow__: if type(p_object.__bobo_always_allow__) is type([]): if p in p_object.__bobo_always_allow__: #allow else: #Do what is normally done for '_' bits. else: if p_object.__bobo_always_allow__(p): #allow else: #Do what is normally done for '_' bits. else: #Do what is normally done for '_' bits. Something vaguely like that. That way you could either specify the exact items that start with '_', or have a method determine it on the fly. This way you would not automatically make all attributes that start with an underscore accessible, and the developer could specify exceptions. -Original Message- From: Chris McDonough [mailto:[EMAIL PROTECTED] Sent: Thursday, June 02, 2005 4:15 PM To: Dan Pozmanter Cc: zope@zope.org Subject: Re: [Zope] Silly question The DWIM of not disallowing traversal of underscore names is useful (because it makes it easy to conventionally mark attrs as private) but it can definitely be a drag if you really do want to publish something that begins with an underscore; this happens a lot when you need to deal with allowing uploads of arbitrary filenames. It might be useful to add something like you propose, except I might take exception to the name isTraversable (everything is traversable, really); maybe just set a magic attr on the object like __allow_underscore_traversal__. However, adding such a feature would need to be done carefully. Much usage of the Zope security machinery utterly depends on not being able to traverse underscore names. - C On Thu, 2005-06-02 at 15:59 -0400, Dan Pozmanter wrote: Wouldn't it be cool if instead of checking explicitly for a leading '_' during traversal, you ran a method isTraversable (On SimpleItem for instance), which by default just checks for a leading '_', but could be overridden in a particular class? Dan ___ 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] Silly question
Yup. FWIW, the actual bit of code that would need to change is around line 299 of ZPublisher/BaseRequest.py: if entry_name[:1]=='_': if debug_mode: return response.debugError( Object name begins with an underscore at: %s % URL) else: return response.forbiddenError(entry_name) Those five lines are pretty important, and though a patch might be small, the impact of any change is potentially very large. I probably wouldn't be able to spare the time to review any patch for inclusion in mainline Zope that allowed underscore traversal from a security perspective just because I'd be paranoid enough to need to do a lot of work to properly do the review. OTOH, you can probably get what you want by patching your source locally. - C On Thu, 2005-06-02 at 16:34 -0400, Dan Pozmanter wrote: The name could change easily enough. How about __bobo_always_allow__ Which can either be: None A List of traversable items A method that takes the path, and returns whether or not it is traversable. So for a path p: if p[0] == '_': if p_object.__bobo_always_allow__: if type(p_object.__bobo_always_allow__) is type([]): if p in p_object.__bobo_always_allow__: #allow else: #Do what is normally done for '_' bits. else: if p_object.__bobo_always_allow__(p): #allow else: #Do what is normally done for '_' bits. else: #Do what is normally done for '_' bits. Something vaguely like that. That way you could either specify the exact items that start with '_', or have a method determine it on the fly. This way you would not automatically make all attributes that start with an underscore accessible, and the developer could specify exceptions. -Original Message- From: Chris McDonough [mailto:[EMAIL PROTECTED] Sent: Thursday, June 02, 2005 4:15 PM To: Dan Pozmanter Cc: zope@zope.org Subject: Re: [Zope] Silly question The DWIM of not disallowing traversal of underscore names is useful (because it makes it easy to conventionally mark attrs as private) but it can definitely be a drag if you really do want to publish something that begins with an underscore; this happens a lot when you need to deal with allowing uploads of arbitrary filenames. It might be useful to add something like you propose, except I might take exception to the name isTraversable (everything is traversable, really); maybe just set a magic attr on the object like __allow_underscore_traversal__. However, adding such a feature would need to be done carefully. Much usage of the Zope security machinery utterly depends on not being able to traverse underscore names. - C On Thu, 2005-06-02 at 15:59 -0400, Dan Pozmanter wrote: Wouldn't it be cool if instead of checking explicitly for a leading '_' during traversal, you ran a method isTraversable (On SimpleItem for instance), which by default just checks for a leading '_', but could be overridden in a particular class? Dan ___ 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 )