[Zope] Bug in Zope?

sean.upton@uniontrib.com sean.upton@uniontrib.com
Wed, 11 Sep 2002 10:06:38 -0700


Likely not related to the problem, but have you tried Python 2.1.3 since
Python 2.2 is not officially supported by Zope 2.x at the moment?

Sean

-----Original Message-----
From: VanL [mailto:vlindberg@verio.net]
Sent: Wednesday, September 11, 2002 10:04 AM
To: zope@zope.org; Patrick Lawrence
Subject: [Zope] Bug in Zope?


Hello,

We are doing a migration of some old data (stored in a standard format 
in text files) into the ZODB.
We have two methods:

ImportCDF is a pythonscript.  It receives a filename and batchname 
(these terms will be explained in a moment.) It gives the file name to 
the second (external) function, ReadCDF.  This part appears to be working.

ReadCDF opens the external file puts each record into a dict.  It then 
returns these dict/records one at a time, using yield.  This function 
appears to be working.

Import CDF then resumes control.  It first takes the batchname and uses 
it for the id if a batch info object (a custom object that we have 
created).  Then it loops over the records returned from ReadCDF, 
creating an object for each returned record.

Here is the problem:

We run this with one cdf (the external text file) and it works 
correctly.  We then run it with a second cdf and it runs correctly. 
 Then we run it with a third, and it fails with:

Error Type: Unauthorized
Error Value: You are not allowed to access POSException in this context

The function in ImportCDF that throws this exception is:

# Loop through our CDF dictionary records
for cdfrec in cdf:
    cemail = cdfrec['Contact Email']
    czopeid = cdfrec['CID']

    # If the customer exists, getattr it.  Otherwise create it.
    if(not hasattr(customers,czopeid)):
        #print "Adding Customer Info for "+czopeid
        try:
            
customers.manage_addProduct['MigrationManager'].manage_addCustomerInfo(id=cz
opeid)
            objects_created = objects_created + 1
        except ZODB.POSException.ReadConflictError:
            continue

Afterwords, the script will throw this same exception for the cdf input 
files for which it previously worked; i.e., the error is persistent. 
 However, if you cut and paste the contents of ImportCDF into a new 
script (e.g., Import-CDF) and run it, it will work correctly until we 
run it on the bad CDF.  After that, the error will persist in the new 
script.

We cannot find any way in which the third (bad) CDF is different than 
the first two (good) CDFs.  They are all the output of the same parser, 
and all validate as being correctly formatted.  The data has no binary 
characters or anything, this is just an XMLish data file.  Further, the 
function that actually deals with the file seems to have no trouble with it.

This entire sequence of events is quite baffling to us, especially the 
fact that the error persists after it has been thrown once -- the script 
never functions correctly again.

Any help or insight would be greatly appreciated.  More specific 
information available on request.  This is Zope 2.5.1, without the 6-14 
hotfix (yet), running on python 2.2.0 on FreeBSD 4.  
Products installed:  CatalogQuery, ExternalEditor, LocalFS, and the 
package with our custom objects (mostly based off Kube).

Thanks,

VanL




_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )