[Zope-Coders] Zope tests: 8 OK

2005-09-29 Thread Zope tests summarizer
Summary of messages to the zope-tests list.
Period Wed Sep 28 11:01:01 2005 UTC to Thu Sep 29 11:01:01 2005 UTC.
There were 8 messages: 8 from Zope Unit Tests.


Tests passed OK
---

Subject: OK : Zope-2_6-branch Python-2.1.3 : Linux
From: Zope Unit Tests
Date: Wed Sep 28 22:25:17 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003199.html

Subject: OK : Zope-2_6-branch Python-2.3.5 : Linux
From: Zope Unit Tests
Date: Wed Sep 28 22:26:47 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003200.html

Subject: OK : Zope-2_7-branch Python-2.3.5 : Linux
From: Zope Unit Tests
Date: Wed Sep 28 22:28:18 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003201.html

Subject: OK : Zope-2_7-branch Python-2.4.1 : Linux
From: Zope Unit Tests
Date: Wed Sep 28 22:29:48 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003202.html

Subject: OK : Zope-2_8-branch Python-2.3.5 : Linux
From: Zope Unit Tests
Date: Wed Sep 28 22:31:18 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003203.html

Subject: OK : Zope-2_8-branch Python-2.4.1 : Linux
From: Zope Unit Tests
Date: Wed Sep 28 22:32:48 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003204.html

Subject: OK : Zope-trunk Python-2.3.5 : Linux
From: Zope Unit Tests
Date: Wed Sep 28 22:34:18 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003205.html

Subject: OK : Zope-trunk Python-2.4.1 : Linux
From: Zope Unit Tests
Date: Wed Sep 28 22:35:48 EDT 2005
URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003206.html

___
Zope-Coders mailing list
Zope-Coders@zope.org
http://mail.zope.org/mailman/listinfo/zope-coders


[Zope-dev] problems setting up methods for a product that registers no classes

2005-09-29 Thread Chris Withers

...zdb in this case.

I need to make a global recompile function available, since zdb 
requires the co_filename attribute of the script's func_code object to 
be set to something meaningful, rather than the useless Script 
(Python) it usually gets set to.


Once zdb is installed, any scripts editted will have this set, but I 
wanted to provide a utility method in a similar vein to python scripts' 
recompile function that could be globally accesed, however since zdb 
registers no classes, I ended up having to do some fairly horrific 
stuff, the following code is from zdb's __init__.py:


# recompilation utlitity
def initialize(context):
# This horrificness is required because Zope doesn't understand the 
concept

# of a Product that doesn't register any classes :-(
pack=context._ProductContext__pack
fd=getattr(pack, '__FactoryDispatcher__', None)
if fd is None:
class __FactoryDispatcher__(FactoryDispatcher):
Factory Dispatcher for a Specific Product

fd = pack.__FactoryDispatcher__ = __FactoryDispatcher__

if not hasattr(pack, '_m'): pack._m=fd.__dict__
pack._m['debug_compile'] = debug_compile
pack._m['debug_compile__roles__'] = ('Manager',)

Now, this breaks in 2.8, so what SHOULD I be doing to make a method 
globally available in a way that works in both 2.7 and 2.8?


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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] Broken objects

2005-09-29 Thread Victor Safronovich
Hello zope-dev!

 http://www.zope.org/Collectors/Zope/1911
 
 I try to migrate my old database from zope 2.6.1.

 I  have Broken objects, but it is impossible to get its state in Zope 2.8.
 In Zope 2.6 Broken objects have states, what i uses to migrate its.
 I think this is because DB.classFactory is overrided to use
 OFS.Uninstalled.BrokenClass, which is bad persistent class.

 the __dict__ of all my Broken objects equals to {'_p_changed':None}.

 my_object._p_mtime does not load it`s state.

-- 
Best regards,
 Victor Safronovich
 NauMen.NauDoc.SoftwareDeveloper  http://www.naumen.ru

___
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] Broken objects

2005-09-29 Thread Chris Withers

Victor Safronovich wrote:

 I  have Broken objects, but it is impossible to get its state in Zope 2.8.
 In Zope 2.6 Broken objects have states, what i uses to migrate its.


I think that was more by luck than by design, but maybe whoever made the 
change can help you out...



 I think this is because DB.classFactory is overrided to use
 OFS.Uninstalled.BrokenClass, which is bad persistent class.


What makes it a bad persisten class?


 the __dict__ of all my Broken objects equals to {'_p_changed':None}.


That seems fair...


 my_object._p_mtime does not load it`s state.


What makes you think it should?

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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[2]: [Zope-dev] Broken objects

2005-09-29 Thread Victor Safronovich
Hello Chris Withers,

Thursday, September 29, 2005, 2:44:52 PM, you wrote:

CW I think that was more by luck than by design, but maybe whoever made the
CW change can help you out...
   I think broken object MUST use ZODB.broken.Broken not OFS.Uninstalled.Broken

CW What makes it a bad persisten class?
   it`s not first-class persistent class.

xCW What makes you think it should?
load object state

-- 
Best regards,
 Victor Safronovich
 NauMen.NauDoc.SoftwareDeveloper  http://www.naumen.ru

___
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] Broken objects

2005-09-29 Thread Jim Fulton

Victor Safronovich wrote:

Hello zope-dev!

 http://www.zope.org/Collectors/Zope/1911
 
 I try to migrate my old database from zope 2.6.1.


 I  have Broken objects, but it is impossible to get its state in Zope 2.8.
 In Zope 2.6 Broken objects have states, what i uses to migrate its.
 I think this is because DB.classFactory is overrided to use
 OFS.Uninstalled.BrokenClass, which is bad persistent class.

 the __dict__ of all my Broken objects equals to {'_p_changed':None}.

 my_object._p_mtime does not load it`s state.


Try setting _p_changed=1.

Or try accessing some other attribute.

If that doesn't work, let me know and I'll look into it.

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] 'Savepoints unsupported' on uploading files into zope

2005-09-29 Thread Chris Withers

lavrinenko wrote:

I suspect the bug is in Image.py, and the whole database adapters thing is a
red herring.

Either that, or Shared.ZRDB has become geb0rken in 2.8 when it comes to
savepoints.


..or, as another possibility, both the DA's these errors have been 
reported with haven't been updated to support savepoints, which would 
make the error message more sensible.


Although why the DAs are becoming involved when you're just doing stuff 
with images is beyond me...


RDB-based user folder? ZSQL methods being used somewhere?

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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: 'Savepoints unsupported' on uploading files into zope

2005-09-29 Thread Chris Withers

lavrinenko wrote:

RDB-based user folder? ZSQL methods being used somewhere?


Yes, exUserFolder with MySQL Authentication Source


Try SimpleUserFolder ;-)

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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[2]: [Zope-dev] Broken objects

2005-09-29 Thread Victor Safronovich
Hello Jim Fulton,

Thursday, September 29, 2005, 2:57:47 PM, you wrote:

JF Victor Safronovich wrote:
 Hello zope-dev!
 
  http://www.zope.org/Collectors/Zope/1911
  
  I try to migrate my old database from zope 2.6.1.
 
  I  have Broken objects, but it is impossible to get its state in Zope 2.8.
  In Zope 2.6 Broken objects have states, what i uses to migrate its.
  I think this is because DB.classFactory is overrided to use
  OFS.Uninstalled.BrokenClass, which is bad persistent class.
 
  the __dict__ of all my Broken objects equals to {'_p_changed':None}.
 
  my_object._p_mtime does not load it`s state.

JF Try setting _p_changed=1.
  object.__dict__ equals to {'_p_changed':1}

JF Or try accessing some other attribute.
  object.data

  AttributeError('data') raise by OFS.Uninstalled.Broken.__getattr__

Inheritance tree of class BrokenClass:

  + OFS.Uninstalled.BrokenClass
+ __builtin__.ExplicitAcquirer
  + ExtensionClass.Base
- __builtin__.object
+ OFS.SimpleItem.Item
  + ExtensionClass.Base
- __builtin__.object
  + webdav.Resource.Resource
+ ExtensionClass.Base
  - __builtin__.object
+ webdav.Lockable.LockableItem
  - webdav.EtagSupport.EtagSupport
  + OFS.CopySupport.CopySource
+ ExtensionClass.Base
  - __builtin__.object
  + App.Management.Tabs
+ ExtensionClass.Base
  - __builtin__.object
  - OFS.Traversable.Traversable
  + OFS.ZDOM.Element
- OFS.ZDOM.Node
  + AccessControl.Owned.Owned
+ ExtensionClass.Base
  - __builtin__.object
  + App.Undo.UndoSupport
+ ExtensionClass.Base
  - __builtin__.object
+ Persistence.Persistent
  + persistent.Persistent
- __builtin__.object
  + ExtensionClass.Base
- __builtin__.object

Contradictions of inherited attributes in class BrokenClass:

  __delattr__ (wrapper_descriptor)
+ OFS.Uninstalled.BrokenClass
  + __builtin__.ExplicitAcquirer
+ ExtensionClass.Base
  @ __builtin__.object
  + OFS.SimpleItem.Item
+ ExtensionClass.Base
  # __builtin__.object
+ webdav.Resource.Resource
  + ExtensionClass.Base
# __builtin__.object
+ OFS.CopySupport.CopySource
  + ExtensionClass.Base
# __builtin__.object
+ App.Management.Tabs
  + ExtensionClass.Base
# __builtin__.object
+ AccessControl.Owned.Owned
  + ExtensionClass.Base
# __builtin__.object
+ App.Undo.UndoSupport
  + ExtensionClass.Base
# __builtin__.object
  + Persistence.Persistent
# persistent.Persistent
  # __builtin__.object
+ ExtensionClass.Base
  # __builtin__.object

  __getattribute__ (wrapper_descriptor)
+ OFS.Uninstalled.BrokenClass
  + __builtin__.ExplicitAcquirer
@ ExtensionClass.Base
  # __builtin__.object
  + OFS.SimpleItem.Item
# ExtensionClass.Base
  # __builtin__.object
+ webdav.Resource.Resource
  # ExtensionClass.Base
# __builtin__.object
+ OFS.CopySupport.CopySource
  # ExtensionClass.Base
# __builtin__.object
+ App.Management.Tabs
  # ExtensionClass.Base
# __builtin__.object
+ AccessControl.Owned.Owned
  # ExtensionClass.Base
# __builtin__.object
+ App.Undo.UndoSupport
  # ExtensionClass.Base
# __builtin__.object
  # Persistence.Persistent
# persistent.Persistent
  # __builtin__.object
# ExtensionClass.Base
  # __builtin__.object

  __setattr__ (wrapper_descriptor)
+ OFS.Uninstalled.BrokenClass
  + __builtin__.ExplicitAcquirer
+ ExtensionClass.Base
  @ __builtin__.object
  + OFS.SimpleItem.Item
+ ExtensionClass.Base
  # __builtin__.object
+ webdav.Resource.Resource
  + ExtensionClass.Base
# __builtin__.object
+ OFS.CopySupport.CopySource
  + ExtensionClass.Base
# __builtin__.object
+ App.Management.Tabs
  + ExtensionClass.Base
# __builtin__.object
+ AccessControl.Owned.Owned
  + ExtensionClass.Base
# __builtin__.object
+ App.Undo.UndoSupport
  + ExtensionClass.Base
# __builtin__.object
  + Persistence.Persistent
# persistent.Persistent
  # __builtin__.object
+ ExtensionClass.Base
  # __builtin__.object

  __setstate__ (method_descriptor)
+ OFS.Uninstalled.BrokenClass
  + __builtin__.ExplicitAcquirer
@ ExtensionClass.Base
  + OFS.SimpleItem.Item
# ExtensionClass.Base
+ webdav.Resource.Resource
  # ExtensionClass.Base
+ OFS.CopySupport.CopySource
  # ExtensionClass.Base
+ App.Management.Tabs
  # 

Re: [Zope-dev] Broken objects

2005-09-29 Thread Jim Fulton

So I guess it didn't work. :)

I'll look into this.  The first step will be to write a test for this.
The intent was definately that you would be able to get to a broken object's
state.

Jim

Victor Safronovich wrote:

Hello Jim Fulton,

Thursday, September 29, 2005, 2:57:47 PM, you wrote:

JF Victor Safronovich wrote:


Hello zope-dev!

http://www.zope.org/Collectors/Zope/1911

I try to migrate my old database from zope 2.6.1.

I  have Broken objects, but it is impossible to get its state in Zope 2.8.
In Zope 2.6 Broken objects have states, what i uses to migrate its.
I think this is because DB.classFactory is overrided to use
OFS.Uninstalled.BrokenClass, which is bad persistent class.

the __dict__ of all my Broken objects equals to {'_p_changed':None}.

my_object._p_mtime does not load it`s state.



JF Try setting _p_changed=1.
  object.__dict__ equals to {'_p_changed':1}

JF Or try accessing some other attribute.
  object.data

  AttributeError('data') raise by OFS.Uninstalled.Broken.__getattr__

Inheritance tree of class BrokenClass:

  + OFS.Uninstalled.BrokenClass
+ __builtin__.ExplicitAcquirer
  + ExtensionClass.Base
- __builtin__.object
+ OFS.SimpleItem.Item
  + ExtensionClass.Base
- __builtin__.object
  + webdav.Resource.Resource
+ ExtensionClass.Base
  - __builtin__.object
+ webdav.Lockable.LockableItem
  - webdav.EtagSupport.EtagSupport
  + OFS.CopySupport.CopySource
+ ExtensionClass.Base
  - __builtin__.object
  + App.Management.Tabs
+ ExtensionClass.Base
  - __builtin__.object
  - OFS.Traversable.Traversable
  + OFS.ZDOM.Element
- OFS.ZDOM.Node
  + AccessControl.Owned.Owned
+ ExtensionClass.Base
  - __builtin__.object
  + App.Undo.UndoSupport
+ ExtensionClass.Base
  - __builtin__.object
+ Persistence.Persistent
  + persistent.Persistent
- __builtin__.object
  + ExtensionClass.Base
- __builtin__.object

Contradictions of inherited attributes in class BrokenClass:

  __delattr__ (wrapper_descriptor)
+ OFS.Uninstalled.BrokenClass
  + __builtin__.ExplicitAcquirer
+ ExtensionClass.Base
  @ __builtin__.object
  + OFS.SimpleItem.Item
+ ExtensionClass.Base
  # __builtin__.object
+ webdav.Resource.Resource
  + ExtensionClass.Base
# __builtin__.object
+ OFS.CopySupport.CopySource
  + ExtensionClass.Base
# __builtin__.object
+ App.Management.Tabs
  + ExtensionClass.Base
# __builtin__.object
+ AccessControl.Owned.Owned
  + ExtensionClass.Base
# __builtin__.object
+ App.Undo.UndoSupport
  + ExtensionClass.Base
# __builtin__.object
  + Persistence.Persistent
# persistent.Persistent
  # __builtin__.object
+ ExtensionClass.Base
  # __builtin__.object

  __getattribute__ (wrapper_descriptor)
+ OFS.Uninstalled.BrokenClass
  + __builtin__.ExplicitAcquirer
@ ExtensionClass.Base
  # __builtin__.object
  + OFS.SimpleItem.Item
# ExtensionClass.Base
  # __builtin__.object
+ webdav.Resource.Resource
  # ExtensionClass.Base
# __builtin__.object
+ OFS.CopySupport.CopySource
  # ExtensionClass.Base
# __builtin__.object
+ App.Management.Tabs
  # ExtensionClass.Base
# __builtin__.object
+ AccessControl.Owned.Owned
  # ExtensionClass.Base
# __builtin__.object
+ App.Undo.UndoSupport
  # ExtensionClass.Base
# __builtin__.object
  # Persistence.Persistent
# persistent.Persistent
  # __builtin__.object
# ExtensionClass.Base
  # __builtin__.object

  __setattr__ (wrapper_descriptor)
+ OFS.Uninstalled.BrokenClass
  + __builtin__.ExplicitAcquirer
+ ExtensionClass.Base
  @ __builtin__.object
  + OFS.SimpleItem.Item
+ ExtensionClass.Base
  # __builtin__.object
+ webdav.Resource.Resource
  + ExtensionClass.Base
# __builtin__.object
+ OFS.CopySupport.CopySource
  + ExtensionClass.Base
# __builtin__.object
+ App.Management.Tabs
  + ExtensionClass.Base
# __builtin__.object
+ AccessControl.Owned.Owned
  + ExtensionClass.Base
# __builtin__.object
+ App.Undo.UndoSupport
  + ExtensionClass.Base
# __builtin__.object
  + Persistence.Persistent
# persistent.Persistent
  # __builtin__.object
+ ExtensionClass.Base
  # __builtin__.object

  __setstate__ (method_descriptor)
+ OFS.Uninstalled.BrokenClass
  + __builtin__.ExplicitAcquirer
@ ExtensionClass.Base
  + OFS.SimpleItem.Item

Re[3]: [Zope-dev] Broken objects

2005-09-29 Thread Victor Safronovich
Hello Victor Safronovich,

Thursday, September 29, 2005, 4:03:17 PM, you wrote:

VS I think __setattr__ and __setstate__ overriden by ExtensionClass, but 
needfully
VS must be from Persistent. Or classFactory must return
VS ZODB.broken.{Persistent}Broken objects
  I changed BrolenClass.__bases__ from Acquisition.Explicit, SimpleItem.Item, 
Persistence.Overridable
  to   Persistence.Overridable,  Acquisition.Explicit, SimpleItem.Item, but this
  is not helped to load state.

  BUT the code below works :))

  shed = app.portal.portal_scheduler # 'shed' is broken object
  con = shed._p_jar
  con._setstate( shed ) # this load state successfully

-- 
Best regards,
 Victor Safronovich
 NauMen.NauDoc.SoftwareDeveloper  http://www.naumen.ru

___
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] Broken objects

2005-09-29 Thread Jim Fulton

Victor Safronovich wrote:

Hello zope-dev!

 http://www.zope.org/Collectors/Zope/1911
 
 I try to migrate my old database from zope 2.6.1.


 I  have Broken objects, but it is impossible to get its state in Zope 2.8.
 In Zope 2.6 Broken objects have states, what i uses to migrate its.
 I think this is because DB.classFactory is overrided to use
 OFS.Uninstalled.BrokenClass, which is bad persistent class.

 the __dict__ of all my Broken objects equals to {'_p_changed':None}.

 my_object._p_mtime does not load it`s state.


Could you tell me more about what you want to happen?

I'm not sure what was happening with state in Zope 2.7, despite the
fact that I wrote that code.  It would be helpful if you could
remind me what the behavior was.

In Zope 2.8, which is to ay ZODB 3.3 and later, the intent is that the
broken objects should provide access to the original state via
the attribute __Broken_state__.  I guess this state isn't being
loaded.  I'll write a test and fix as necessary to make sure it is.

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 )


Re[2]: [Zope-dev] Broken objects

2005-09-29 Thread Victor Safronovich
Hello Jim Fulton,

Thursday, September 29, 2005, 4:34:31 PM, you wrote:

JF So I guess it didn't work. :)

JF I'll look into this.  The first step will be to write a test for this.
JF The intent was definately that you would be able to get to a broken object's
JF state.

not Test but for example ( if needed i try to spend time to write test )
zopectl debug
Starting debugger (the name app is bound to the top-level Zope object)
 from Persistence import Persistent
 class Test(Persistent):
... def __init__(self, id):
... self.id = id
...
 test1 = Test('test1')
 test2 = Test('test2')
 app.test1 = test1
 app.test1.test2 = test2
 import transaction
 transaction.commit()

# ctrl + d here
zopectl debug
Starting debugger (the name app is bound to the top-level Zope object)
2005-09-29 10:50:09 WARNING ZODB Could not import class 'Test' from module 
'__main__'
 test1 = app.test1
 test1.__dict__
{'_p_changed': None}
 test1._p_activate()
 test1.__dict__
{'_p_changed': None}
 test1.test2
Traceback (most recent call last):
  File stdin, line 1, in ?
AttributeError: test2
 test1.__class__.__bases__
(class 'OFS.Uninstalled.BrokenClass',)
 conn = test1._p_jar
 conn.setstate(test1)
 test1.__dict__
{'test2': __main__.Test object at 0x4015836c, 'id': 'test1'}
 del app.test1
 import transaction
 transaction.commit()





-- 
Best regards,
 Victor Safronovich
 NauMen.NauDoc.SoftwareDeveloper  http://www.naumen.ru

___
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[2]: [Zope-dev] Broken objects

2005-09-29 Thread Victor Safronovich
Hello Jim Fulton,

Thursday, September 29, 2005, 5:02:46 PM, you wrote:

JF Could you tell me more about what you want to happen?
i want to get the states of broken objects, to migrate them.

-- 
Best regards,
 Victor Safronovich
 NauMen.NauDoc.SoftwareDeveloper  http://www.naumen.ru

___
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] Strange security issue with Zope 2.8.1

2005-09-29 Thread Jens Vagelpohl
I have found a strange security issue with Zope 2.8.1 that seems to  
stem from code not doing what it was supposed to do in Zope 2.7.x,  
but which works in 2.8.1 and then causes other side effects in code  
that relied on the broken behavior.


Symptom: In Zope 2.8.1 it is *impossible* to override a  
ClassSecurityInfo security declaration in an Archetypes-derived  
content item. (I have a small set of unit tests that proves the  
behavior under Zope 2.8.1 if anyone is interested)


A little background: When you register an Archetypes-derived content  
type, it will do all the generated accessor/setter method magic and  
then call InitializeClass a second time.


The code in lib/python/App/class_init.py has changed between Zope  
2.7.x and Zope 2.8 in order to support new-style classes. To be more  
precise, instead of manipulating the class __dict__ directly we now  
use setattr/delattr/etc. This change seems to have un-broken code  
which did not do what the code comments suggest. Namely, when a class  
is sent through class_init.default_class_init__ (better known as  
Globals.InitializeClass) the class __dict__ is searched to find  
objects that look like ClassSecurityInfo instances in order to read  
and apply the security settings. After finding the ClassSecurityInfo  
instance, it is force-deleted from the object (the comments say, out  
of paranoia). However, somehow this did not work correctly in Zope  
2.7.x, where the deletion call looked like...


del dict[key]

(dict being the class __dict__, and key being the name of the  
ClassSecurityInfo instance). Under Zope 2.8, it looks like this:


delattr(self, key)

(self being the class object).

Under Zope 2.7, the security object *would still be there* when  
hitting InitializeClass for the second time via Archetypes'  
registerType, which in turn meant Archetypes would not instantiate  
its own ClassSecurityInfo instance and stuff it with the declarations  
from whatever Archetypes-derived base class you used.


In Zope 2.8, the deletion actually works as intended - but due to  
that fact Archetypes will instantiate its own ClassSecurityInfo and  
populate it with the declarations from the base class that I am  
trying to override. So the overridden settings are all overwritten  
again by the base class declaration.


My question is, what is the reasoning behind deleting the  
ClassSecurityInfo object from the class after it has been read the  
first time? How can this be implemented in a sane way so that custom  
security declarations can be retained?


jens

___
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: Strange security issue with Zope 2.8.1

2005-09-29 Thread Florent Guillaume

Jens Vagelpohl wrote:
I have found a strange security issue with Zope 2.8.1 that seems to  
stem from code not doing what it was supposed to do in Zope 2.7.x,  but 
which works in 2.8.1 and then causes other side effects in code  that 
relied on the broken behavior.


Symptom: In Zope 2.8.1 it is *impossible* to override a  
ClassSecurityInfo security declaration in an Archetypes-derived  content 
item. (I have a small set of unit tests that proves the  behavior under 
Zope 2.8.1 if anyone is interested)


A little background: When you register an Archetypes-derived content  
type, it will do all the generated accessor/setter method magic and  
then call InitializeClass a second time.


The code in lib/python/App/class_init.py has changed between Zope  2.7.x 
and Zope 2.8 in order to support new-style classes. To be more  precise, 
instead of manipulating the class __dict__ directly we now  use 
setattr/delattr/etc. This change seems to have un-broken code  which 
did not do what the code comments suggest. Namely, when a class  is sent 
through class_init.default_class_init__ (better known as  
Globals.InitializeClass) the class __dict__ is searched to find  objects 
that look like ClassSecurityInfo instances in order to read  and apply 
the security settings. After finding the ClassSecurityInfo  instance, it 
is force-deleted from the object (the comments say, out  of paranoia). 
However, somehow this did not work correctly in Zope  2.7.x, where the 
deletion call looked like...


del dict[key]

(dict being the class __dict__, and key being the name of the  
ClassSecurityInfo instance). Under Zope 2.8, it looks like this:


delattr(self, key)

(self being the class object).

Under Zope 2.7, the security object *would still be there* when  hitting 
InitializeClass for the second time via Archetypes'  registerType, which 
in turn meant Archetypes would not instantiate  its own 
ClassSecurityInfo instance and stuff it with the declarations  from 
whatever Archetypes-derived base class you used.


In Zope 2.8, the deletion actually works as intended - but due to  that 
fact Archetypes will instantiate its own ClassSecurityInfo and  populate 
it with the declarations from the base class that I am  trying to 
override. So the overridden settings are all overwritten  again by the 
base class declaration.


My question is, what is the reasoning behind deleting the  
ClassSecurityInfo object from the class after it has been read the  
first time? How can this be implemented in a sane way so that custom  
security declarations can be retained?


My understanding (and the way we use it when monkey patching for instance) 
is that whenevery you apply new security to a class, you create a new 
ClassSecurityInfo on it. It only defines new stuff to do. The real 
synthesized security is still stored in __ac_permissions__.


class C(SimpleItem):
security = ClassSecurityInfo()
security.declareProtected(...)
def foo(): ...

InitializeClass(C)

then later on:

security = ClassSecurityInfo()
C.security = security
security.declareProtected(...)
C.newmethod = something
InitializeClass(C)

Anyway that's what I do. I never relied on a preexisting C.security.

Florent


--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] problems setting up methods for a product that registers no classes

2005-09-29 Thread Dieter Maurer
Chris Withers wrote at 2005-9-29 09:17 +0100:
...zdb in this case.

I need to make a global recompile function available, since zdb 
requires the co_filename attribute of the script's func_code object to 
be set to something meaningful, rather than the useless Script 
(Python) it usually gets set to.
 ...
Now, this breaks in 2.8, so what SHOULD I be doing to make a method 
globally available in a way that works in both 2.7 and 2.8?

You could use part of the old style initialization, the methods
declaration to be precise.

You see an example in .../Products/ZSQLMethods/__init__.py.

Be warned, however: the old style initialization puts
the declared methods on the OFS.Folder class.

Thus, you better choose a name that is unlikely to conflict
with other methods that might be relevant for classes
derived from Folder...

-- 
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] SiteAccess (Enh. VHM) still needed, or merged to Zope?

2005-09-29 Thread Tino Wildenhain
Am Mittwoch, den 28.09.2005, 20:49 -0400 schrieb Jeff Kowalczyk:
 Most references I find (google, The Plone Book - McKay, Building Websites
 W/ Plone - Cooper) on virtual hosting Zope behind Apache recommend
 starting with sfm's SiteAccess enhanced Virtual Host Monster product:
 http://www.zope.org/Members/sfm/SiteAccessEnhanced/view
 
 Reportedly last updated 2001-08-19, is SAE really so mature that it has
 not subsequently needed updates or merited a merge into Zope's own VHM?
 
 I need to map the incoming URL http://(*.)foo.com/new/* to a Plone
 instance at http://localhost:8080/foo/*; , and later change the
 inbound mapping to http://(*.)foo.com/* after customer acceptance.
 
 I'm guessing that this is the most vanilla virtual hosting requirement
 possible, and I want to use the simplest configuration to accomplish it.
 If the old SEH 2.1.0 is the recommended tool with Zope-2.8.1, I'm sure the
 existing docs will be enough to figure it out. Thanks.

I believe Zopes VHM is the very SEH but updated since it became part
of zope. In recent zope versions there is in fact nothing to do to
use it because an instance is automatically created.

You only do the usual apache rewrite dance and be ready :)

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


Re: [Zope] Zope Debugger 0.8.0 Released!

2005-09-29 Thread Luca Olivetti

En/na Chris Withers ha escrit:
For more information, please see: 
http://www.simplistix.co.uk/software/zope/zdb


2005-09-29 08:43:11 ERROR Zope Couldn't install zdb
Traceback (most recent call last):
  File /usr/local/zope-2.8.1-final/lib/python/OFS/Application.py, 
line 773, in install_product

initmethod(context)
  File /home/luca/zopetest/Products/zdb/__init__.py, line 64, in 
initialize

pack._m['debug_compile'] = debug_compile
TypeError: object does not support item assignment
Traceback (most recent call last):
  File /usr/local/zope-2.8.1-final/lib/python/Zope2/Startup/run.py, 
line 56, in ?

run()
  File /usr/local/zope-2.8.1-final/lib/python/Zope2/Startup/run.py, 
line 21, in run

starter.prepare()
  File 
/usr/local/zope-2.8.1-final/lib/python/Zope2/Startup/__init__.py, line 
98, in prepare

self.startZope()
  File 
/usr/local/zope-2.8.1-final/lib/python/Zope2/Startup/__init__.py, line 
257, in startZope

Zope2.startup()
  File /usr/local/zope-2.8.1-final/lib/python/Zope2/__init__.py, line 
47, in startup

_startup()
  File /usr/local/zope-2.8.1-final/lib/python/Zope2/App/startup.py, 
line 95, in startup

OFS.Application.initialize(application)
  File /usr/local/zope-2.8.1-final/lib/python/OFS/Application.py, 
line 298, in initialize

initializer.initialize()
  File /usr/local/zope-2.8.1-final/lib/python/OFS/Application.py, 
line 327, in initialize

self.install_products()
  File /usr/local/zope-2.8.1-final/lib/python/OFS/Application.py, 
line 595, in install_products

return install_products(app)
  File /usr/local/zope-2.8.1-final/lib/python/OFS/Application.py, 
line 626, in install_products

folder_permissions, raise_exc=debug_mode)
  File /usr/local/zope-2.8.1-final/lib/python/OFS/Application.py, 
line 773, in install_product

initmethod(context)
  File /home/luca/zopetest/Products/zdb/__init__.py, line 64, in 
initialize

pack._m['debug_compile'] = debug_compile
TypeError: object does not support item assignment


Bye
--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004  Fax +34 93 5883007
___
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: Using the set object within page templates

2005-09-29 Thread Chris Withers

Alexander Limi wrote:

A more interesting question: shouldn't it be available by default?

It's a basic data strucure along the lines of lists and dicts, right? 
Or  have I missed a use case for it where it may be scary to use in a 
Python  Script? :)


No, it's just an object type that came along since the default list of 
acceptable things in python scripts was last updated.


Should be trivial to change, but stick a collector entry in for it anyway...

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] External Method Working Directory?

2005-09-29 Thread Chris Withers

jwithers wrote:

eep, another one, hope we're not related ;-)


Can anyone tell me what the default working directory for an external
method is?


You can't rely on it being anything. If you're working with files, you 
need to be very careful...


Further, I need this to create a file temporarily in Extensions. 


Why?


I would prefer not to have to hardwire the location of Extension into the
code, since that would make the script non-portable to other instances easily.

Any advice on this would be appreciated.


I'd suggest looking at python's tempfile module...

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] SiteAccess (Enh. VHM) still needed, or merged to Zope?

2005-09-29 Thread Chris Withers

Jeff Kowalczyk wrote:

Reportedly last updated 2001-08-19, is SAE really so mature that it has
not subsequently needed updates or merited a merge into Zope's own VHM?


Use the one that ships with Zope, it's likely to be better maintained...


I need to map the incoming URL http://(*.)foo.com/new/* to a Plone
instance at http://localhost:8080/foo/*; , and later change the
inbound mapping to http://(*.)foo.com/* after customer acceptance.


Are you front ending with Apache?
If not, you should be...


I'm guessing that this is the most vanilla virtual hosting requirement
possible, and I want to use the simplest configuration to accomplish it.
If the old SEH 2.1.0 is the recommended tool with Zope-2.8.1, I'm sure the
existing docs will be enough to figure it out. Thanks.


There are plenty of examples of how to do this using the normal stuff 
that ships with Zope...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Output only the first or a particular record using TAL

2005-09-29 Thread Chris Withers

Julian Yap wrote:

Another query I had was on the practice of using control flow
(ie. if, for, etc.. statements).  I guess the best way is to
keep your control flow in Python scripts?  Is this the common practise?


Well, it seems to be that a little bit of python in a tal:condition is 
quite common, but if it gets more than that then yeah, probably move the 
logic out to a Script (Python)...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope Debugger 0.8.0 Released!

2005-09-29 Thread Chris Withers

Luca Olivetti wrote:


folder_permissions, raise_exc=debug_mode)
  File /usr/local/zope-2.8.1-final/lib/python/OFS/Application.py, line 
773, in install_product

initmethod(context)
  File /home/luca/zopetest/Products/zdb/__init__.py, line 64, in 
initialize

pack._m['debug_compile'] = debug_compile
TypeError: object does not support item assignment


*sigh*, looks like some of the project registration machinery has 
changed between 2.7 and 2.8.


I've opened a collector entry for this:

https://secure.simplistix.co.uk/support/issue176

...and I'll go and see if anyone on zope-dev@zope.org knows how to do 
this in 2.8 and 2.7...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Zope Debugger 0.8.0 Released!

2005-09-29 Thread Pascal Peregrina
If what is intended with this code is to monkey patch some class, then I had
a similar problem on 2.8.0 and I solved it by using setattr() instead of
item assignment (and it works with 2.7.6).

Pascal 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Chris Withers
Sent: 29 September 2005 09:12
To: Luca Olivetti
Cc: [EMAIL PROTECTED]; zope@zope.org
Subject: Re: [Zope] Zope Debugger 0.8.0 Released!

Luca Olivetti wrote:

 folder_permissions, raise_exc=debug_mode)
   File /usr/local/zope-2.8.1-final/lib/python/OFS/Application.py, 
 line 773, in install_product
 initmethod(context)
   File /home/luca/zopetest/Products/zdb/__init__.py, line 64, in 
 initialize
 pack._m['debug_compile'] = debug_compile
 TypeError: object does not support item assignment

*sigh*, looks like some of the project registration machinery has changed
between 2.7 and 2.8.

I've opened a collector entry for this:

https://secure.simplistix.co.uk/support/issue176

...and I'll go and see if anyone on zope-dev@zope.org knows how to do this
in 2.8 and 2.7...

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.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] Zope Debugger 0.8.0 Released!

2005-09-29 Thread Chris Withers

Pascal Peregrina wrote:

If what is intended with this code is to monkey patch some class, then I had
a similar problem on 2.8.0 and I solved it by using setattr() instead of
item assignment (and it works with 2.7.6).


It depends, did you try using the recompile method and did it work with 
your patch?


cheers,

Chris

PS: If you find patches like this that solve problems, I'd really 
appreciate it if you could feed them back into the collector, or even on 
a mailing list, that is kinda how open source is supposed to work ;-)


--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope Debugger 0.8.0 Released!

2005-09-29 Thread Lennart Regebro
On 9/29/05, Chris Withers [EMAIL PROTECTED] wrote:
 *sigh*, looks like some of the project registration machinery has
 changed between 2.7 and 2.8.

Well, you are using __dict__, which you aren't supposed t odo for new
style classes, which FactoryDispatchers now seem to be.

This code:

if not hasattr(pack, '_m'): pack._m=fd.__dict__

fd.debug_compile = debug_compile

fd.debug_compile__roles__ = ('Manager',)


Goes around that, by setting the attributes on the original object
instead of trying to manipulate the dicts directly. But I don't
understand what you are trying to do, so I don't know if it's a good
idea.
--
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Zope Debugger 0.8.0 Released!

2005-09-29 Thread Pascal Peregrina
That solution was given to me by someone on the zope mailing list by the
time Zope 2.8.0 was out :) 

-Original Message-
From: Chris Withers [mailto:[EMAIL PROTECTED] 
Sent: 29 September 2005 09:26
To: Pascal Peregrina
Cc: Luca Olivetti; [EMAIL PROTECTED]; zope@zope.org
Subject: Re: [Zope] Zope Debugger 0.8.0 Released!

Pascal Peregrina wrote:
 If what is intended with this code is to monkey patch some class, then 
 I had a similar problem on 2.8.0 and I solved it by using setattr() 
 instead of item assignment (and it works with 2.7.6).

It depends, did you try using the recompile method and did it work with your
patch?

cheers,

Chris

PS: If you find patches like this that solve problems, I'd really appreciate
it if you could feed them back into the collector, or even on a mailing
list, that is kinda how open source is supposed to work ;-)

--
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.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] Zope Debugger 0.8.0 Released!

2005-09-29 Thread Chris Withers

Pascal Peregrina wrote:

That solution was given to me by someone on the zope mailing list by the
time Zope 2.8.0 was out :) 


*shrugs*

Still a fix for zdb that would have been handy for me to have.

Are you using any zodb-based python scripts or are all yours 
FSPythonScripts?


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope Debugger 0.8.0 Released!

2005-09-29 Thread Lennart Regebro
On 9/29/05, Lennart Regebro [EMAIL PROTECTED] wrote:
 This code:

 if not hasattr(pack, '_m'): pack._m=fd.__dict__
 fd.debug_compile = debug_compile
 fd.debug_compile__roles__ = ('Manager',)

Seems to work. I just needed to debug a script, and it worked fine!
Great product!
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope Debugger 0.8.0 Released!

2005-09-29 Thread Peter Bengtsson
For those people who are porting code to Zope 2.8, perhaps you want
to read this:
http://www.peterbe.com/plog/itp-on-zope-2.8.0

2005/9/29, Lennart Regebro [EMAIL PROTECTED]:
 On 9/29/05, Lennart Regebro [EMAIL PROTECTED] wrote:
  This code:
 
  if not hasattr(pack, '_m'): pack._m=fd.__dict__
  fd.debug_compile = debug_compile
  fd.debug_compile__roles__ = ('Manager',)

 Seems to work. I just needed to debug a script, and it worked fine!
 Great product!
 ___
 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 )



--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] how to export values from a form to SPSS or Excel format?

2005-09-29 Thread Georgakopoulos Nicolas
I have a page that a client submit a questionnaire (multiply choices) 
and I want to export the values from the answers to SPSS   logistic 
format  so I can send it by mail...

Can some one give me the right directions here ?

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope Debugger 0.8.0 Released!

2005-09-29 Thread Chris Withers

Lennart Regebro wrote:

   if not hasattr(pack, '_m'): pack._m=fd.__dict__
   fd.debug_compile = debug_compile
   fd.debug_compile__roles__ = ('Manager',)


Ah, but did you need to use zdb's recompile method?


Seems to work. I just needed to debug a script, and it worked fine!
Great product!


Thanks :-)

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Aquisition, UserFolder and security

2005-09-29 Thread bruno modulix
Dieter Maurer wrote:
 bruno modulix wrote at 2005-9-28 10:02 +0200:
 
Dieter Maurer wrote:
...

Sounds like a permission to role mapping flaw...

  Apparently, roles controlled by the Portal UserFolder (e.g.
  Authenticated) are allowed to do things in your CPM that
  you only be allowed by roles controlled by their UserFolder.

You may be able to fix this by making the roles controlled
by the Portal and the CPM level disjoint.

Authenticated cannot be made disjoint -- but you may not use
it inside your CPMs.

The problem here is that CPS (the portal and all CPMs are CPS instances)
uses predefined roles, on which the various workflows relies, so that
would mean renaming all roles - differently - on each CPM, and modifying
the workflows too.
 
 
 I think that is would only be necessary that the roles
 are disjoint between Portal and CPM. All CPMs can use
 the same roles.

Nope. Some users may have different roles from CPM to CPM.

 
Given that the customer is going to create new CPMs
at will, I'm afraid this solution is somewhat unpractical...
 
 
 Maybe, this changes when you need to touch only the Portal roles?
 
I don't want to mess with CPS predifined roles. But thanks anyway.

-- 
Bruno Desthuilliers
Développeur
[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] emergency access problems

2005-09-29 Thread michael nt milne
Hi

I appear to be having difficulty logging into the ZMI using the password created on install. I did change some settings to my root login using the Samplex member product etc but didn't change the password, login etc.


Anyway I've followed all the instructions in security.txt, telnetting in as the user that made the zopeinstance and running

 python zpasswd.py access

using SHA-1 and then entering nothing for domains ( I presumed that this would give access for all domains etc)

I then get an access denied message on running this and the access file is not created.

Any help would be appreciated. I guess I can always create a new zope instance and delete the old one?
___
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: emergency access problems

2005-09-29 Thread michael nt milne
Just to say that I solved this by using ./zopectl adduser name password with zope shut down.
On 9/29/05, michael nt milne [EMAIL PROTECTED] wrote:

Hi

I appear to be having difficulty logging into the ZMI using the password created on install. I did change some settings to my root login using the Samplex member product etc but didn't change the password, login etc. 


Anyway I've followed all the instructions in security.txt, telnetting in as the user that made the zopeinstance and running

 python zpasswd.py access

using SHA-1 and then entering nothing for domains ( I presumed that this would give access for all domains etc)

I then get an access denied message on running this and the access file is not created.

Any help would be appreciated. I guess I can always create a new zope instance and delete the old one?
___
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] emergency access problems

2005-09-29 Thread J Cameron Cooper

michael nt milne wrote:

Hi
 
I appear to be having difficulty logging into the ZMI using the password 
created on install. I did change some settings to my root login using 
the Samplex member product etc but didn't change the password, login etc.
 
Anyway I've followed all the instructions in security.txt, telnetting in 
as the user that made the zopeinstance and running
 
  python zpasswd.py access
 
using SHA-1 and then entering nothing for domains ( I presumed that this 
would give access for all domains etc)
 
I then get an access denied message on running this and the access file 
is not created.
 
Any help would be appreciated. I guess I can always create a new zope 
instance and delete the old one?


You must make sure the access file is in the right place (an instance 
home, I believe) and you have to restart for it to take effect.


--jcc
--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] emergency access problems

2005-09-29 Thread michael nt milne
Yes, the access file was being created in the homeinstance. One thing I didn't do was run the zpasswd.py file when zope was stopped though, as I did with ./zopectl
On 9/29/05, J Cameron Cooper [EMAIL PROTECTED] wrote:
michael nt milne wrote: Hi I appear to be having difficulty logging into the ZMI using the password
 created on install. I did change some settings to my root login using the Samplex member product etc but didn't change the password, login etc. Anyway I've followed all the instructions in 
security.txt, telnetting in as the user that made the zopeinstance and running python zpasswd.py access using SHA-1 and then entering nothing for domains ( I presumed that this
 would give access for all domains etc) I then get an access denied message on running this and the access file is not created. Any help would be appreciated. I guess I can always create a new zope
 instance and delete the old one?You must make sure the access file is in the right place (an instancehome, I believe) and you have to restart for it to take effect. --jcc--
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: Using the set object within page templates

2005-09-29 Thread Dieter Maurer
Alexander Limi wrote at 2005-9-28 20:40 +0200:
A more interesting question: shouldn't it be available by default?

It's a basic data strucure along the lines of lists and dicts, right? Or  
have I missed a use case for it where it may be scary to use in a Python  
Script? :)

Paranoic people would want to have similar DOS attack protection as
for other similar data types (e.g. lists).
This would make some work...

I expect you could get a patches welcome :-)

-- 
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] Aquisition, UserFolder and security

2005-09-29 Thread Dieter Maurer
bruno modulix wrote at 2005-9-29 13:20 +0200:
 ...
The problem here is that CPS (the portal and all CPMs are CPS instances)
uses predefined roles, on which the various workflows relies, so that
would mean renaming all roles - differently - on each CPM, and modifying
the workflows too.
 
 
 I think that is would only be necessary that the roles
 are disjoint between Portal and CPM. All CPMs can use
 the same roles.

Nope. Some users may have different roles from CPM to CPM.

I did not say that the user to role mapping should (or even must)
be identical in all CPMs but that the *set* of roles *might* be identical
in all CPMs -- or to say it differently: that you are not forced
to use disjoint role sets for any pair of CPMs.

Hopefully, you see the difference...

-- 
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 Method Working Directory?

2005-09-29 Thread Dieter Maurer
jwithers wrote at 2005-9-28 15:43 -0700:
 ...
I have an external method that at this point is made up of nothing but
os.getcwd() and lives in my Extensions directory. When it is run, it
reports the working directory as being one of my Products directories.

Some products are broken (they change the current working directory).
Apparently, you have one of them installed.

In general, it is a bad idea to change the current working directory
in a multi-threaded application (such as Zope).


An External Method does not have a specific working directory
when it is run. Because Zope must not modify the working
directory, it cannot let it follow the run of an External Method.
The current working directory remains what it was.

On a system with well behaving products, the current working
directory remains the INSTANCE_HOME.

 ...
Further, I need this to create a file temporarily in Extensions. 
I would prefer not to have to hardwire the location of Extension into the
code, since that would make the script non-portable to other instances easily.

The Extensions directory is a bad place for temporary files...

-- 
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 Method Working Directory?

2005-09-29 Thread jwithers
On Thu, 2005-09-29 at 00:20, Chris Withers wrote:
 eep, another one, hope we're not related ;-)
 
When I saw your posts on newsgroups years ago, I almost gave up python
programming altogether Chris, thinking that any given field of endeavor
needs only one Withers, but decided to go ahead and chance it.

  Can anyone tell me what the default working directory for an external
  method is?
 
 You can't rely on it being anything. If you're working with files, you 
 need to be very careful...
 
  Further, I need this to create a file temporarily in Extensions. 
 
 Why?

Because I need to feed the file to Mailman for evil purposes of my own
(well, fairly mundane purposes of allowing my zope app to manipulate
mailman list memberships, really) that the prototype mailman adapter I
found doesn't meet. And yeah, tempfile would work, although, I have to
admit I really don't see the point of it when you are only storing one
file. I am probably missing some usecase or good programming practice
here, but it seems like it saves you a single line for the delete in
return for an extra module import. 

Peter Bengtsson gave me the solution in just using the INSTANCE_HOME
variable directly, which is bound in external scripts. That beat the
daylights out of the solution that had come up wjth the help of some
folks on ICQ of using self.Control_Panel.getINSTANCE_HOME(). And Deiter
is right and it is dim to put the temporary file in Extensions and it
will be put in var instead. Not sure what I was thinking there.


John Withers 

 
  I would prefer not to have to hardwire the location of Extension into the
  code, since that would make the script non-portable to other instances 
  easily.
  
  Any advice on this would be appreciated.
 
 I'd suggest looking at python's tempfile module...
 
 Chris

___
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 Method Working Directory?

2005-09-29 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

jwithers wrote:

 Because I need to feed the file to Mailman for evil purposes of my own
 (well, fairly mundane purposes of allowing my zope app to manipulate
 mailman list memberships, really) that the prototype mailman adapter I
 found doesn't meet.

BTW, I have experimented with the XML-RPC patch for Mailman 2.1.6:

 
http://sourceforge.net/tracker/index.php?func=detailaid=1244799group_id=103atid=300103

It seems to work nicely from command-line Python, although I haven't
yet got around to driving it from within Zope.

 And yeah, tempfile would work, although, I have to
 admit I really don't see the point of it when you are only storing one
 file. I am probably missing some usecase or good programming practice
 here, but it seems like it saves you a single line for the delete in
 return for an extra module import.

What you really buy with that import is that other people have thought
about, and fixed bugs for, the race conditions involved in creating
tempfiles.

 Peter Bengtsson gave me the solution in just using the INSTANCE_HOME
 variable directly, which is bound in external scripts. That beat the
 daylights out of the solution that had come up wjth the help of some
 folks on ICQ of using self.Control_Panel.getINSTANCE_HOME(). And Deiter
 is right and it is dim to put the temporary file in Extensions and it
 will be put in var instead. Not sure what I was thinking there.

In a locked down configuration, the user as whom Zope runs won't be
able to write into any directory on the system *except* the 'var'
directory (and a 'logs' directory if you feel obsessive about keeping
the logs elsewhere), so that works out well.


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDPEhq+gerLs4ltQ4RAibEAKCCqeR2hpZ0bCkH1aAueTfT6k358wCgp5nE
Xve1bwxcwQ+rKehuxtNpaKw=
=YUXq
-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] Problem with links containing non-ascii characters in StructuredText

2005-09-29 Thread Maurits van Rees
Hi,

I have a problem getting links to function in StructuredText when they
have non-ascii characters in the title.  

- This will render as a link: Zope website:http://zope.org/

- This will render literally: Zöpe website:http://zope.org/

[Notice the diaeresis in the second case.]

This can of course be solved by using html entities like 'ouml;'.
But I have just started using utf-8 so I don't have to bother myself
with writing html entities.  There is probably a Python method that
can translate 'ö' into 'ouml;', but I would like the resulting html
code to be humanly readable utf-8 as well.  I wouldn't mind iso-8859-1
as that's what it basically is in my case (I'm Dutch) but utf-8 seems
the way to go.

Anyway, here is a script that illustrates the problem.  It has some
extra non-ascii characters thrown in just to show that these
characters don't give any problems outside of the links.

--
import Products.PythonScripts.standard

print 
htmlhead
meta http-equiv=Content-Type content=text/html;charset=utf-8 /
/headbody


text=
Let's link to a Zope website:http://zope.org/.

Nó. Let's lïnk to à Zöpe website:http://zope.org/.


ppss=Products.PythonScripts.standard.structured_text
print ppss(unicode(text, 'iso-8859-1').encode('utf-8'))
# The following line has the same effect:
#print unicode(ppss(text), 'iso-8859-1').encode('utf-8')

print /body

return printed
--

Don't worry, this is not how I usually make my pages. ;-)

This results in the following html source code:

--
htmlhead
meta http-equiv=Content-Type content=text/html;charset=utf-8 /
/headbody

pLet's link to a a href=http://zope.org/;Zope website/a./p
pNó. Let's lïnk to à Zöpe website:http://zope.org/./p

/body
--

That last failed link is obviously not as it should be.  Does anyone
know a solution?  I failed to find one with Google.

I wondered if it had to do with the diaeresis specifically, but the
same thing goes wrong with e.g. 'Zópe'.

BTW, I use the Debian Sarge version of Zope 2.7.

Thanks,

-- 
Maurits van Rees | http://maurits.vanrees.org/ [Dutch/Nederlands] 
Public GnuPG key:  http://maurits.vanrees.org/var/gpgkey.asc
It can seem like you're doing just fine,
but the creep's creeping into your mind. - Neal Morse


signature.asc
Description: Digital 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: Problem with links containing non-ascii characters in StructuredText

2005-09-29 Thread Chris Beaven

Maurits van Rees wrote:

Hi,

I have a problem getting links to function in StructuredText when they
have non-ascii characters in the title.  


This can of course be solved by using html entities like 'ouml;'.
But I have just started using utf-8 so I don't have to bother myself
with writing html entities. 


This wouldn't solve the overall problem - not all utf-8 characters have 
html entities. I work with Māori macrons which don't so I'll be 
listening keenly to discussion about this problem.


___
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] Problem with links containing non-ascii characters in StructuredText

2005-09-29 Thread Andreas Jung

You have to configure your locale support in etc/zope.conf properly.

-aj

--On 30. September 2005 00:26:14 +0200 Maurits van Rees 
[EMAIL PROTECTED] wrote:



Hi,

I have a problem getting links to function in StructuredText when they
have non-ascii characters in the title.

- This will render as a link: Zope website:http://zope.org/

- This will render literally: Zöpe website:http://zope.org/

[Notice the diaeresis in the second case.]

This can of course be solved by using html entities like 'ouml;'.
But I have just started using utf-8 so I don't have to bother myself
with writing html entities.  There is probably a Python method that
can translate 'ö' into 'ouml;', but I would like the resulting html
code to be humanly readable utf-8 as well.  I wouldn't mind iso-8859-1
as that's what it basically is in my case (I'm Dutch) but utf-8 seems
the way to go.

Anyway, here is a script that illustrates the problem.  It has some
extra non-ascii characters thrown in just to show that these
characters don't give any problems outside of the links.

--
import Products.PythonScripts.standard

print 
htmlhead
meta http-equiv=Content-Type content=text/html;charset=utf-8 /
/headbody


text=
Let's link to a Zope website:http://zope.org/.

Nó. Let's lïnk to à Zöpe website:http://zope.org/.


ppss=Products.PythonScripts.standard.structured_text
print ppss(unicode(text, 'iso-8859-1').encode('utf-8'))
# The following line has the same effect:
# print unicode(ppss(text), 'iso-8859-1').encode('utf-8')

print /body

return printed
--

Don't worry, this is not how I usually make my pages. ;-)

This results in the following html source code:

--
htmlhead
meta http-equiv=Content-Type content=text/html;charset=utf-8 /
/headbody

pLet's link to a a href=http://zope.org/;Zope website/a./p
pNó. Let's lïnk to à Zöpe website:http://zope.org/./p

/body
--

That last failed link is obviously not as it should be.  Does anyone
know a solution?  I failed to find one with Google.

I wondered if it had to do with the diaeresis specifically, but the
same thing goes wrong with e.g. 'Zópe'.

BTW, I use the Debian Sarge version of Zope 2.7.

Thanks,

--
Maurits van Rees | http://maurits.vanrees.org/ [Dutch/Nederlands]
Public GnuPG key:  http://maurits.vanrees.org/var/gpgkey.asc
It can seem like you're doing just fine,
but the creep's creeping into your mind. - Neal Morse






pgpE7wLdPn1AU.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-DB] Installing DCOracle2 with Oracle 10g

2005-09-29 Thread Matthew T . Kromer

Heh, I should have read the problem a bit closer:

i686-pc-linux-gnu-gcc -pthread -shared ./dco2.o  
-L/usr/lib/oracle/10.1.0.4/client/lib/ -lclntsh -lcommon -lcore4  
-lnlsrtl3 -Wl,-rpath,/usr/lib/oracle/10.1.0.4/client/lib -o  
./dco2.so
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/../../../../i686- 
pc- linux-gnu/bin/ld: cannot find -lcommon

collect2: ld returned 1 exit status
make[1]: *** [dco2.so] Error 1


It looks to me like the makefile thinks you're running Oracle 8.0; not  
Oracle 10.  Take a peek in the testora script in the src directory;  
you'll probably want to tweak it to skip the detections for oracle  
version and ends up making that call to sed at the bottom; for anything  
higher than Oracle 8.0 you should only need to link  -lclntsh in.  Also  
set the -DORACLE8i and -DORACLE9 defines manually, I expect.  That will  
cause the code to compile slightly differently.


On Sep 28, 2005, at 10:34 PM, Seth Gottlieb wrote:


Thanks for responding. I commented out line 92:
#include stdio.h

and moved
#include Python.h
(which was around line 126) to the first of the includes. I still get  
the same error message. Anything else to try?


Thanks,

Seth

Matthew T. Kromer wrote:

Not sure, but I think DCOracle2 includes both Python.h and stdio.h --  
try removing stdio.h and making the python.h include the first  
include.



On Sep 28, 2005, at 2:38 PM, Seth Gottlieb wrote:

I have been trying to compile DCOracle2 and found the instructions  
from evstumpf at ucdavis.


When I do that, I get the error message:

i686-pc-linux-gnu-gcc -pthread -fPIC -DNDEBUG  
-I/usr/include/python2.3 -I/usr/include/python2.3 @DEFS@  
-I/usr/lib/oracle/10.1.0.4/client/rdbms/demo  
-I/usr/lib/oracle/10.1.0.4/client/network/public  
-I/usr/lib/oracle/10.1.0.4/client/plsql/public  
-I/usr/lib/oracle/10.1.0.4/client/rdbms/public -DUSEOWNXID -c  
././dco2.c -o ./dco2.o
i686-pc-linux-gnu-gcc: cannot specify -o with -c or -S and multiple  
compilationsmake[1]: *** [dco2.o] Error 1


Then I followed the idea to change DEFS to nothing in the post by  
Matt at Bane:


[EMAIL PROTECTED]@
to
DEFS=

When I do this, I get:

i686-pc-linux-gnu-gcc -pthread -fPIC -DNDEBUG  
-I/usr/include/python2.3 -I/usr/include/python2.3  
-I/usr/lib/oracle/10.1.0.4/client/rdbms/demo  
-I/usr/lib/oracle/10.1.0.4/client/network/public  
-I/usr/lib/oracle/10.1.0.4/client/plsql/public  
-I/usr/lib/oracle/10.1.0.4/client/rdbms/public -DUSEOWNXID -c  
././dco2.c -o ./dco2.o

In file included from /usr/include/python2.3/Python.h:8,
from dco2.c:125:
/usr/include/python2.3/pyconfig.h:856:1: warning: _POSIX_C_SOURCE  
redefined

In file included from /usr/include/stdio.h:28,
from dco2.c:92:
/usr/include/features.h:190:1: warning: this is the location of the  
previous definition
i686-pc-linux-gnu-gcc -pthread -shared ./dco2.o  
-L/usr/lib/oracle/10.1.0.4/client/lib/ -lclntsh -lcommon -lcore4  
-lnlsrtl3 -Wl,-rpath,/usr/lib/oracle/10.1.0.4/client/lib -o  
./dco2.so
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/../../../../i686- 
pc- linux-gnu/bin/ld: cannot find -lcommon

collect2: ld returned 1 exit status
make[1]: *** [dco2.so] Error 1

My environment is:
Python: 2.3.4
Zope: 2.3.4
OS: Gentoo
Oracle: Instant Client 10.1.0.4 with extra .h files from the full  
install. put into rdbms/public:

nzerror.h
nzt.h
occi.h
occiAQ.h
occiCommon.h
occiControl.h
occiData.h
occiObjects.h
oci.h
oci1.h
oci8dp.h
ociap.h
ociapr.h
ocidef.h
ocidem.h
ocidfn.h
ociextp.h
ocikpr.h
ocixmldb.h
odci.h
oratypes.h
ori.h
orid.h
orl.h
oro.h
ort.h
xa.h



Some observations
The error messages says that I should have .h files under rdbms/demo  
but mines does not have any and I was unable to find them anywhere.



Thanks,

Seth

--
Seth Gottlieb
Optaros, Inc.
60 Canal Street
Boston, MA 02114
e: [EMAIL PROTECTED]
v: 617.227.1855 ext. 107
f: 617.227.1755
m: 617.852.2956

___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db






--
Seth Gottlieb
Optaros, Inc.
60 Canal Street
Boston, MA 02114
e: [EMAIL PROTECTED]
v: 617.227.1855 ext. 107
f: 617.227.1755
m: 617.852.2956


___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] Installing DCOracle2 with Oracle 10g

2005-09-29 Thread Seth Gottlieb
Excellent. I put a link to your instructions here: 
http://zopewiki.org/Oracle. Pardon the double comment. It didn't seem to 
take the first time.


--Seth

Jet Wilda wrote:


Here http://www.zope.org/Members/jetfu/HowToInstallDcOracle2/howto_view
is a how to I wrote up on how I got DCOracle2 to install with Oracle 10g

Jet

 


Message: 6
Date: Thu, 29 Sep 2005 10:57:23 -0400
From: Seth Gottlieb [EMAIL PROTECTED]
Subject: Re: [Zope-DB] Installing DCOracle2 with Oracle 10g
To: Matthew T.Kromer [EMAIL PROTECTED]
Cc: zope-db@zope.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=US-ASCII; format=flowed

I think that did the trick. It seemed to compile. This is 
what I did for 
those who also run into the same trouble:


changed all instances (3) of dword * to dvoid * in src/dco2.c
changed DEFS= @DEFS@ to DEFS=  in src/Makefile
skipped all the Oracle detection logic and hard coded:
ORADEF=-DORACLE10G
ORAINCLUDES=-lclntsh

One thing that I did notice is that compiling this way was very quick 
and did not have any kind of success message. At the end of 
the compile 
you will notice that a dco2.so was moved into the DCOracle2 directory.


Thanks Matt for the tips.

--Seth


Matthew T.Kromer wrote:

   


Heh, I should have read the problem a bit closer:

 

i686-pc-linux-gnu-gcc -pthread -shared ./dco2.o 
-L/usr/lib/oracle/10.1.0.4/client/lib/ -lclntsh -lcommon -lcore4 
-lnlsrtl3 -Wl,-rpath,/usr/lib/oracle/10.1.0.4/client/lib 
   


-o ./dco2.so
   

/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/../../../../i686- 
   


pc- linux-gnu/bin/ld: cannot find -lcommon
collect2: ld returned 1 exit status
make[1]: *** [dco2.so] Error 1
   

It looks to me like the makefile thinks you're running 
 

Oracle 8.0; not 
   

Oracle 10. Take a peek in the testora script in the src directory; 
you'll probably want to tweak it to skip the detections for oracle 
version and ends up making that call to sed at the bottom; for 
anything higher than Oracle 8.0 you should only need to 
 

link -lclntsh 
   

in. Also set the -DORACLE8i and -DORACLE9 defines manually, 
 

I expect. 
   


That will cause the code to compile slightly differently.

On Sep 28, 2005, at 10:34 PM, Seth Gottlieb wrote:

 


Thanks for responding. I commented out line 92:
#include stdio.h

and moved
#include Python.h
(which was around line 126) to the first of the includes. 
   

I still get 
   


the same error message. Anything else to try?

Thanks,

Seth

Matthew T. Kromer wrote:

   

Not sure, but I think DCOracle2 includes both Python.h 
 

and stdio.h 
   

-- try removing stdio.h and making the python.h include the first 
include.



On Sep 28, 2005, at 2:38 PM, Seth Gottlieb wrote:

 

I have been trying to compile DCOracle2 and found the 
   

instructions 
   


from evstumpf at ucdavis.

When I do that, I get the error message:

i686-pc-linux-gnu-gcc -pthread -fPIC -DNDEBUG 
-I/usr/include/python2.3 -I/usr/include/python2.3 @DEFS@ 
-I/usr/lib/oracle/10.1.0.4/client/rdbms/demo 
-I/usr/lib/oracle/10.1.0.4/client/network/public 
-I/usr/lib/oracle/10.1.0.4/client/plsql/public 
-I/usr/lib/oracle/10.1.0.4/client/rdbms/public -DUSEOWNXID -c 
././dco2.c -o ./dco2.o
i686-pc-linux-gnu-gcc: cannot specify -o with -c or -S 
   

and multiple 
   


compilationsmake[1]: *** [dco2.o] Error 1

Then I followed the idea to change DEFS to nothing in 
   

the post by 
   


Matt at Bane:

[EMAIL PROTECTED]@
to
DEFS=

When I do this, I get:

i686-pc-linux-gnu-gcc -pthread -fPIC -DNDEBUG 
-I/usr/include/python2.3 -I/usr/include/python2.3 
-I/usr/lib/oracle/10.1.0.4/client/rdbms/demo 
-I/usr/lib/oracle/10.1.0.4/client/network/public 
-I/usr/lib/oracle/10.1.0.4/client/plsql/public 
-I/usr/lib/oracle/10.1.0.4/client/rdbms/public -DUSEOWNXID -c 
././dco2.c -o ./dco2.o

In file included from /usr/include/python2.3/Python.h:8,
from dco2.c:125:
/usr/include/python2.3/pyconfig.h:856:1: warning: 
   

_POSIX_C_SOURCE 
   


redefined
In file included from /usr/include/stdio.h:28,
from dco2.c:92:
/usr/include/features.h:190:1: warning: this is the 
   

location of the 
   


previous definition
i686-pc-linux-gnu-gcc -pthread -shared ./dco2.o 
-L/usr/lib/oracle/10.1.0.4/client/lib/ -lclntsh -lcommon -lcore4 
-lnlsrtl3 -Wl,-rpath,/usr/lib/oracle/10.1.0.4/client/lib 
   


-o ./dco2.so
   

/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/../../../../i686- 
   


pc- linux-gnu/bin/ld: cannot find -lcommon
collect2: ld returned 1 exit status
make[1]: *** [dco2.so] Error 1

My environment is:
Python: 2.3.4
Zope: 2.3.4
OS: Gentoo
Oracle: Instant Client 10.1.0.4 with extra .h files from 
   

the full 
   


install. put into rdbms/public:
nzerror.h
nzt.h
occi.h
occiAQ.h
occiCommon.h
occiControl.h
occiData.h
occiObjects.h
oci.h
oci1.h
oci8dp.h
ociap.h
ociapr.h
ocidef.h
ocidem.h
ocidfn.h
ociextp.h
ocikpr.h
ocixmldb.h
odci.h
oratypes.h
ori.h